]> granicus.if.org Git - python/log
python
6 years agobpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)
Ned Deily [Tue, 27 Mar 2018 21:16:49 +0000 (17:16 -0400)]
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)

test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
(cherry picked from commit 12f74d8608c15cacd9d5786524e2be9ca36f007e)

Co-authored-by: Nathan Henrie <n8henrie@users.noreply.github.com>
Also, re-enable test_read_pty_output on macOS.

6 years agobpo-33151: Handle submodule resources (GH-6268)
Barry Warsaw [Tue, 27 Mar 2018 16:59:38 +0000 (09:59 -0700)]
bpo-33151: Handle submodule resources (GH-6268)

6 years agobpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195)
Cheryl Sabella [Tue, 27 Mar 2018 01:29:33 +0000 (21:29 -0400)]
bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195)

6 years agobpo-32873: Treat type variables and special typing forms as immutable by copy and...
Ivan Levkivskyi [Mon, 26 Mar 2018 22:01:12 +0000 (23:01 +0100)]
bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216)

This also fixes python/typing#512
This also fixes python/typing#511

As was discussed in both issues, some typing forms deserve to be treated
as immutable by copy and pickle modules, so that:
* copy(X) is X
* deepcopy(X) is X
* loads(dumps(X)) is X  # pickled by reference

This PR adds such behaviour to:
* Type variables
* Special forms like Union, Any, ClassVar
* Unsubscripted generic aliases to containers like List, Mapping, Iterable

This not only resolves inconsistencies mentioned in the issues, but also
improves backwards compatibility with previous versions of Python
(including 3.6).

Note that this requires some dances with __module__ for type variables
(similar to NamedTuple) because the class TypeVar itself is define in typing,
while type variables should get module where they were defined.

https://bugs.python.org/issue32873

6 years agobpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
Alexey Izbyshev [Mon, 26 Mar 2018 19:49:35 +0000 (22:49 +0300)]
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)

bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.

6 years agobpo-33141: Have dataclasses.Field pass through __set_name__ to any default argument...
Eric V. Smith [Mon, 26 Mar 2018 17:29:16 +0000 (13:29 -0400)]
bpo-33141: Have dataclasses.Field pass through __set_name__ to any default argument. (GH-6260)

This is part of PEP 487 and the descriptor protocol.

6 years agoFix error message in sqlite connection thread check. (GH-6028)
Takuya Akiba [Mon, 26 Mar 2018 15:14:00 +0000 (00:14 +0900)]
Fix error message in sqlite connection thread check. (GH-6028)

6 years agobpo-6986: Add a comment to clarify a test of _json.make_encoder(). (GH-3789)
Oren Milman [Mon, 26 Mar 2018 15:04:39 +0000 (18:04 +0300)]
bpo-6986: Add a comment to clarify a test of _json.make_encoder(). (GH-3789)

6 years agoCorrected link targets in collections.rst (GH-1052)
Michael Seifert [Mon, 26 Mar 2018 11:40:35 +0000 (13:40 +0200)]
Corrected link targets in collections.rst (GH-1052)

6 years agoFix description about SimpleXMLRPCServer constructor parameter bind_and_activate...
cocoatomo [Mon, 26 Mar 2018 11:03:40 +0000 (20:03 +0900)]
Fix description about SimpleXMLRPCServer constructor parameter bind_and_activate. (GH-776)

Passing True as the `bind_and_activate` *do* immediately opening and binding to their socket.

6 years agoGitignore gmon.out (GH-5796)
Neeraj Badlani [Mon, 26 Mar 2018 10:11:47 +0000 (03:11 -0700)]
Gitignore gmon.out (GH-5796)

gmon.out is generated when profiling turned on

Full Configuration:
./configure --prefix=$PWD/install --enable-profiling  --enable-big-digits=30
--with-pydebug --with-assertions  --with-valgrind

6 years agoFix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)
Stefano Taschini [Mon, 26 Mar 2018 09:41:30 +0000 (11:41 +0200)]
Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)

6 years agobpo-33096: Fix ttk.Treeview.insert. (GH-6228)
Garvit Khatri [Mon, 26 Mar 2018 07:02:05 +0000 (12:32 +0530)]
bpo-33096: Fix ttk.Treeview.insert. (GH-6228)

Allow ttk.Treeview.insert to insert iid that has a false boolean value.
Note iid=0 and iid=False would be same.

6 years agoMinor fixes to dataclass tests. (GH-6243)
Eric V. Smith [Mon, 26 Mar 2018 00:37:33 +0000 (20:37 -0400)]
Minor fixes to dataclass tests. (GH-6243)

 Also, re-enable a test for ClassVars with default_factory.

6 years agoClarify fd inheritance when close_fds=False. (GH-6240)
Gregory P. Smith [Sun, 25 Mar 2018 17:27:59 +0000 (10:27 -0700)]
Clarify fd inheritance when close_fds=False. (GH-6240)

Clarify the subprocess documentation.

6 years agobpo-33053: Remove test_cmd_line_script debugging print (GH-6237)
Nick Coghlan [Sun, 25 Mar 2018 13:47:54 +0000 (23:47 +1000)]
bpo-33053: Remove test_cmd_line_script debugging print (GH-6237)

I noticed this had slipped into the original commit when
resolving a merge conflict for the backport to 3.7.

6 years agoTrivial improvements to dataclasses tests. (GH-6234)
Eric V. Smith [Sun, 25 Mar 2018 13:04:32 +0000 (09:04 -0400)]
Trivial improvements to dataclasses tests. (GH-6234)

6 years agobpo-33053: -m now adds *starting* directory to sys.path (GH-6231)
Nick Coghlan [Sun, 25 Mar 2018 13:03:10 +0000 (23:03 +1000)]
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)

Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.

This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.

6 years agobpo-33042: Fix pre-initialization sys module configuration (GH-6157)
Nick Coghlan [Sun, 25 Mar 2018 10:44:30 +0000 (20:44 +1000)]
bpo-33042: Fix pre-initialization sys module configuration (GH-6157)

- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
  called before Py_Initialize
- also enhanced the existing embedding test cases
  to check for expected settings in the sys module

6 years agobpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229)
Christian Heimes [Sun, 25 Mar 2018 10:36:13 +0000 (12:36 +0200)]
bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229)

Harden ssl module against LibreSSL CVE-2018-8970.
X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test
ensures that NULL bytes are not allowed.

Signed-off-by: Christian Heimes <christian@python.org>
6 years agobpo-32943: Fix confusing error message for rot13 codec (GH-5869)
Xiang Zhang [Sun, 25 Mar 2018 04:09:21 +0000 (12:09 +0800)]
bpo-32943: Fix confusing error message for rot13 codec (GH-5869)

6 years agoFix invalid escape sequence: use raw string. (GH-6225)
Eric V. Smith [Sun, 25 Mar 2018 03:02:21 +0000 (23:02 -0400)]
Fix invalid escape sequence: use raw string. (GH-6225)

6 years agobpo-33134: dataclasses: use function dispatch table for hash, instead of a string...
Eric V. Smith [Sun, 25 Mar 2018 02:10:14 +0000 (22:10 -0400)]
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)

* Change _hash_action to be a function table lookup, instead of a list
of strings which is then tested with if statements.

6 years agoTrivial dataclass cleanups: (GH-6218)
Eric V. Smith [Sat, 24 Mar 2018 21:20:26 +0000 (17:20 -0400)]
Trivial dataclass cleanups: (GH-6218)

- When adding a single element to a list, use .append() instead of
  += and creating a new list.
- For consistency, import the copy module, instead of just deepcopy. This
  leaves only a module at the class level, instead of a function.
- Improve some comments.
- Improve some whitespace.
- Use tuples instead of lists.
- Simplify a test.

6 years agobpo-33132: Fix reference counting issues in the compiler. (GH-6209)
Serhiy Storchaka [Sat, 24 Mar 2018 20:42:35 +0000 (22:42 +0200)]
bpo-33132: Fix reference counting issues in the compiler. (GH-6209)

6 years agobpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210)
Christian Heimes [Sat, 24 Mar 2018 14:41:37 +0000 (15:41 +0100)]
bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210)

LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.

Documentation updates and fixes for failing tests will be provided in
another patch set.

Signed-off-by: Christian Heimes <christian@python.org>
6 years agobpo-24334: Remove inaccurate match_hostname call (#6211)
Christian Heimes [Sat, 24 Mar 2018 14:36:50 +0000 (15:36 +0100)]
bpo-24334: Remove inaccurate match_hostname call (#6211)

Commit 141c5e8c re-added match_hostname() call. The resurrection of the
function call was never intended and was solely a merge mistake.

Signed-off-by: Christian Heimes <christian@python.org>
6 years agobpo-32932: More revealing error message when non-str objects in __all__ (GH-5848)
Xiang Zhang [Sat, 24 Mar 2018 10:39:36 +0000 (18:39 +0800)]
bpo-32932: More revealing error message when non-str objects in __all__ (GH-5848)

6 years agobpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC (GH-6061)
Himanshu Lakhara [Fri, 23 Mar 2018 21:26:35 +0000 (02:56 +0530)]
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC (GH-6061)

6 years agobpo-31639: Use threads in http.server module. (GH-5018)
Julien Palard [Fri, 23 Mar 2018 16:40:33 +0000 (17:40 +0100)]
bpo-31639: Use threads in http.server module. (GH-5018)

6 years agoFix a reference to the MRE book in re docs (GH-1113)
Berker Peksag [Fri, 23 Mar 2018 13:46:52 +0000 (16:46 +0300)]
Fix a reference to the MRE book in re docs (GH-1113)

Reported by Maksym Nikulyak on docs.p.o.

6 years agobpo-30953: Improve error messages and add tests for jumping (GH-6196)
Serhiy Storchaka [Fri, 23 Mar 2018 12:46:45 +0000 (14:46 +0200)]
bpo-30953: Improve error messages and add tests for jumping (GH-6196)

into/out of an except block.

6 years agobpo-33041: Rework compiling an "async for" loop. (#6142)
Serhiy Storchaka [Fri, 23 Mar 2018 12:34:35 +0000 (14:34 +0200)]
bpo-33041: Rework compiling an "async for" loop. (#6142)

* Added new opcode END_ASYNC_FOR.
* Setting global StopAsyncIteration no longer breaks "async for" loops.
* Jumping into an "async for" loop is now disabled.
* Jumping out of an "async for" loop no longer corrupts the stack.
* Simplify the compiler.

6 years agobpo-32999: ast: Convert useless check to assert (GH-6197)
INADA Naoki [Fri, 23 Mar 2018 09:19:34 +0000 (18:19 +0900)]
bpo-32999: ast: Convert useless check to assert (GH-6197)

6 years agobpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but...
Eric V. Smith [Thu, 22 Mar 2018 20:28:48 +0000 (16:28 -0400)]
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192)

If a dataclass has a member variable that's of type Field, but it doesn't have a type annotation, raise TypeError.

6 years agobpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189)
INADA Naoki [Thu, 22 Mar 2018 12:52:42 +0000 (21:52 +0900)]
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189)

bpo-33018 (GH-5944) fixed bpo-32999 too.  So fc7df0e6 is not required
anymore.  Revert it except test case.

6 years agobpo-33018: Improve issubclass() error checking and message. (GH-5944)
jab [Thu, 22 Mar 2018 11:26:06 +0000 (00:26 +1300)]
bpo-33018: Improve issubclass() error checking and message. (GH-5944)

This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.

6 years agoUpgrade pip to v9.0.3 and setuptools to v39.0.1 (#6184)
Donald Stufft [Thu, 22 Mar 2018 02:47:44 +0000 (22:47 -0400)]
Upgrade pip to v9.0.3 and setuptools to v39.0.1 (#6184)

6 years agoAdd 'Field' to dataclasses.__all__. (GH-6182)
Eric V. Smith [Wed, 21 Mar 2018 21:10:22 +0000 (17:10 -0400)]
Add 'Field' to dataclasses.__all__. (GH-6182)

- Add missing 'Field' to __all__.
- Improve tests to catch this.

6 years agoFIX failure on OSX sem_getvalue (#6180)
Thomas Moreau [Wed, 21 Mar 2018 17:56:27 +0000 (18:56 +0100)]
FIX failure on OSX sem_getvalue (#6180)

6 years agobpo-33078 - Fix queue size on pickling error (GH-6119)
Thomas Moreau [Wed, 21 Mar 2018 15:50:28 +0000 (16:50 +0100)]
bpo-33078 - Fix queue size on pickling error (GH-6119)

6 years agoFix typos in mmap() error messages (GH-6173)
Zackery Spytz [Wed, 21 Mar 2018 06:02:37 +0000 (00:02 -0600)]
Fix typos in mmap() error messages (GH-6173)

6 years agobpo-32896: Fix error when subclassing a dataclass with a field that uses a default_fa...
Eric V. Smith [Wed, 21 Mar 2018 02:00:23 +0000 (22:00 -0400)]
bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170)

Fix the way that new annotations in a class are detected.

6 years agobpo-27683: Fix a regression for host() of ipaddress network objects (GH-6016)
Xiang Zhang [Wed, 21 Mar 2018 00:25:13 +0000 (08:25 +0800)]
bpo-27683: Fix a regression for host() of ipaddress network objects (GH-6016)

The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.

6 years ago bpo-18802: Add more details to ipaddress documentation (GH-6083)
Cheryl Sabella [Wed, 21 Mar 2018 00:09:15 +0000 (20:09 -0400)]
 bpo-18802: Add more details to ipaddress documentation (GH-6083)

Original patch by Jon Foster and Berker Peksag.

6 years agobpo-28247: Document Windows executable creation in zipapp (GH-6158)
Cheryl Sabella [Tue, 20 Mar 2018 22:23:19 +0000 (18:23 -0400)]
bpo-28247: Document Windows executable creation in zipapp (GH-6158)

6 years agobpo-33034: Improve exception message when cast fails for {Parse,Split}Result.port...
Matt Eaton [Tue, 20 Mar 2018 06:41:37 +0000 (01:41 -0500)]
bpo-33034: Improve exception message when cast fails for {Parse,Split}Result.port (GH-6078)

6 years agobpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152)
Eric V. Smith [Tue, 20 Mar 2018 01:07:51 +0000 (21:07 -0400)]
bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152)

If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.

6 years agobpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127)
aetracht [Mon, 19 Mar 2018 18:41:32 +0000 (14:41 -0400)]
bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127)

6 years agobpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived...
Eric V. Smith [Mon, 19 Mar 2018 00:40:34 +0000 (20:40 -0400)]
bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (#6147)

If a non-dataclass derives from a frozen dataclass, allow attributes to be set.
Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen.
Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.

6 years agobpo-19417: Add test_bdb.py (GH-5217)
xdegaye [Sun, 18 Mar 2018 20:02:47 +0000 (21:02 +0100)]
bpo-19417: Add test_bdb.py (GH-5217)

6 years agoRevert "bpo-30406: Make async and await proper keywords (#1669)" (GH-6143)
Jelle Zijlstra [Sun, 18 Mar 2018 16:54:33 +0000 (09:54 -0700)]
Revert "bpo-30406: Make async and await proper keywords (#1669)" (GH-6143)

This reverts commit ac317700ce7439e38a8b420218d9a5035bba92ed.

(Reverts only the lib2to3 part.)

6 years agobpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)
Serhiy Storchaka [Sun, 18 Mar 2018 07:56:52 +0000 (09:56 +0200)]
bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)

6 years agobpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
Serhiy Storchaka [Sun, 18 Mar 2018 07:55:53 +0000 (09:55 +0200)]
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)

6 years agobpo-33041: Add tests for jumps in/out of 'async with' blocks. (#6110)
Serhiy Storchaka [Sun, 18 Mar 2018 07:53:08 +0000 (09:53 +0200)]
bpo-33041: Add tests for jumps in/out of 'async with' blocks. (#6110)

6 years agobpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
Aviv Palivoda [Sun, 18 Mar 2018 00:48:55 +0000 (02:48 +0200)]
bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)

It was actually fixed in SQLite 3.8.8, not 3.8.7.

6 years agoUpdate pip to 9.0.2 and setuptools to 38.6.1 (#6133)
Donald Stufft [Sat, 17 Mar 2018 15:13:48 +0000 (11:13 -0400)]
Update pip to 9.0.2 and setuptools to 38.6.1 (#6133)

6 years agobpo-32374: m_traverse may be called with m_state=NULL (GH-5140)
Marcel Plch [Sat, 17 Mar 2018 05:41:20 +0000 (06:41 +0100)]
bpo-32374:  m_traverse may be called with m_state=NULL (GH-5140)

Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.

6 years agobpo-33021: Fix GCC 7 warning (-Wmaybe-uninitialized) in mmapmodule.c (#6117)
Zackery Spytz [Wed, 14 Mar 2018 20:08:01 +0000 (14:08 -0600)]
bpo-33021: Fix GCC 7 warning (-Wmaybe-uninitialized) in mmapmodule.c (#6117)

6 years agolib2to3: Add more tests (#6101)
Łukasz Langa [Tue, 13 Mar 2018 17:53:22 +0000 (10:53 -0700)]
lib2to3: Add more tests (#6101)

6 years agobpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)
xdegaye [Tue, 13 Mar 2018 17:31:31 +0000 (18:31 +0100)]
bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)

(cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)

6 years agobpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)
Miro Hrončok [Tue, 13 Mar 2018 09:56:43 +0000 (10:56 +0100)]
bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.

6 years agobpo-33064: lib2to3: support trailing comma after *args and **kwargs (#6096)
Łukasz Langa [Tue, 13 Mar 2018 07:44:49 +0000 (00:44 -0700)]
bpo-33064: lib2to3: support trailing comma after *args and **kwargs (#6096)

New tests also added.

I also made the comments in line with the builtin Grammar/Grammar. PEP 306 was
withdrawn, Kees Blom's railroad program has been lost to the sands of time for
at least 16 years now (I found a python-dev post from people looking for it).

6 years agobpo-29719: Remove Date and Release field in whatsnew/3.7 and 8 (GH-6093)
Ned Deily [Tue, 13 Mar 2018 01:16:08 +0000 (21:16 -0400)]
bpo-29719: Remove Date and Release field in whatsnew/3.7 and 8 (GH-6093)

6 years agoAdd macOS installer Conclusion file
Ned Deily [Mon, 12 Mar 2018 19:44:21 +0000 (15:44 -0400)]
Add macOS installer Conclusion file

6 years agobpo-22674: fix test_strsignal on OSX (GH-6085)
Antoine Pietri [Mon, 12 Mar 2018 19:03:14 +0000 (20:03 +0100)]
bpo-22674: fix test_strsignal on OSX (GH-6085)

6 years agoFix docs markup for asyncio current_task() and all_tasks() (#6089)
Andrew Svetlov [Mon, 12 Mar 2018 18:50:50 +0000 (20:50 +0200)]
Fix docs markup for asyncio current_task() and all_tasks() (#6089)

6 years agobpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (#6084)
Thomas Moreau [Mon, 12 Mar 2018 17:18:41 +0000 (18:18 +0100)]
bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (#6084)

6 years agosignal: add strsignal() (#6017)
Antoine Pietri [Mon, 12 Mar 2018 13:42:34 +0000 (14:42 +0100)]
signal: add strsignal() (#6017)

Co-authored-by: Vajrasky Kok <sky.kok@speaklikeaking.com>
6 years agobpo-33021: Release the GIL during fstat() calls (GH-6019)
Nir Soffer [Sun, 11 Mar 2018 23:39:22 +0000 (01:39 +0200)]
bpo-33021: Release the GIL during fstat() calls (GH-6019)

fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()

6 years agobpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)
Antoine Pitrou [Sun, 11 Mar 2018 18:21:38 +0000 (19:21 +0100)]
bpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)

In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows).  Avoid failing with a non-0 exit code in those conditions.

Report and initial patch by poxthegreat.

6 years agoDrop confusing commented out code in pystrtod.c (GH-6072)
Siddhesh Poyarekar [Sun, 11 Mar 2018 09:45:10 +0000 (15:15 +0530)]
Drop confusing commented out code in pystrtod.c (GH-6072)

6 years agobpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937)
Serhiy Storchaka [Sun, 11 Mar 2018 09:07:06 +0000 (11:07 +0200)]
bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937)

6 years agobpo-32925: Optimized iterating and containing test for literal lists (GH-5842)
Serhiy Storchaka [Sun, 11 Mar 2018 08:54:47 +0000 (10:54 +0200)]
bpo-32925: Optimized iterating and containing test for literal lists (GH-5842)

consisting of non-constants: `x in [a, b]` and `for x in [a, b]`.
The case of all constant elements already was optimized.

6 years agobpo-32946: Speed up "from ... import ..." from non-packages. (GH-5873)
Serhiy Storchaka [Sun, 11 Mar 2018 08:52:37 +0000 (10:52 +0200)]
bpo-32946: Speed up "from ... import ..." from non-packages. (GH-5873)

6 years agobpo-32338: OrderedDict import is no longer needed in re. (#4891)
Serhiy Storchaka [Sun, 11 Mar 2018 06:38:13 +0000 (08:38 +0200)]
bpo-32338: OrderedDict import is no longer needed in re. (#4891)

6 years agobpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026)
Serhiy Storchaka [Sun, 11 Mar 2018 06:32:47 +0000 (08:32 +0200)]
bpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026)

6 years agobpo-32996: Improve What's New in 3.7. (#5983)
Serhiy Storchaka [Sun, 11 Mar 2018 01:48:14 +0000 (03:48 +0200)]
bpo-32996: Improve What's New in 3.7. (#5983)

6 years agobpo-33045: Fix typos in SSL documentation (GH-6065)
Matt Eaton [Sun, 11 Mar 2018 01:00:04 +0000 (19:00 -0600)]
bpo-33045: Fix typos in SSL documentation (GH-6065)

6 years agobpo-27645: Skip test_bad_target_in_transaction if SQLite == 3.8.7.1 (GH-6067)
Berker Peksag [Sun, 11 Mar 2018 00:38:50 +0000 (03:38 +0300)]
bpo-27645: Skip test_bad_target_in_transaction if SQLite == 3.8.7.1 (GH-6067)

6 years agobpo-27645: Add support for native backup facility of SQLite (GH-4238)
Emanuele Gaifas [Sat, 10 Mar 2018 22:08:31 +0000 (23:08 +0100)]
bpo-27645: Add support for native backup facility of SQLite (GH-4238)

6 years agobpo-30249: Improve struct.unpack_from() error messages (GH-6059)
Xiang Zhang [Sat, 10 Mar 2018 18:58:52 +0000 (02:58 +0800)]
bpo-30249: Improve struct.unpack_from() error messages (GH-6059)

6 years agobpo-33041: Add missed error checks when compile "async for" (#6053)
Serhiy Storchaka [Sat, 10 Mar 2018 16:49:26 +0000 (18:49 +0200)]
bpo-33041: Add missed error checks when compile "async for" (#6053)

and remove redundant code.

6 years agobpo-33041: Fixed bytecode generation for "async for" with a complex target. (#6052)
Serhiy Storchaka [Sat, 10 Mar 2018 16:22:34 +0000 (18:22 +0200)]
bpo-33041: Fixed bytecode generation for "async for" with a complex target. (#6052)

A StopAsyncIteration raised on assigning or unpacking will be now propagated
instead of stopping the iteration.

6 years agobpo-33037: Skip sending/receiving after SSL transport closing (GH-6044)
Andrew Svetlov [Sat, 10 Mar 2018 15:48:35 +0000 (17:48 +0200)]
bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044)

* Skip write()/data_received() if sslpipe is destroyed

6 years agobpo-26701: Improve documentation for the rounding special methods. (#6054)
Serhiy Storchaka [Sat, 10 Mar 2018 15:18:32 +0000 (17:18 +0200)]
bpo-26701: Improve documentation for the rounding special methods. (#6054)

6 years agobpo-26701: Add documentation for __trunc__ (GH-6022)
Eric Appelt [Sat, 10 Mar 2018 08:44:12 +0000 (02:44 -0600)]
bpo-26701: Add documentation for __trunc__ (GH-6022)

`int` fails back to `__trunc__` is `__int__` isn't defined, so cover
that in the docs.

6 years agoWarn that dbm.dumb.open() can crash Python (GH-6047)
Brett Cannon [Fri, 9 Mar 2018 23:58:40 +0000 (15:58 -0800)]
Warn that dbm.dumb.open() can crash Python (GH-6047)

6 years agoWarn that compile() can crash when compiling to an AST object (GH-6043)
Brett Cannon [Fri, 9 Mar 2018 21:13:32 +0000 (13:13 -0800)]
Warn that compile() can crash when compiling to an AST object (GH-6043)

6 years agobpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter...
Brett Cannon [Fri, 9 Mar 2018 20:03:22 +0000 (12:03 -0800)]
bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960)

6 years agocontrolflow: Use full example for "5 through 9" (GH-5907)
Steven M. Vascellaro [Fri, 9 Mar 2018 19:57:21 +0000 (14:57 -0500)]
controlflow: Use full example for "5 through 9" (GH-5907)

Replace example result of "5 through 9" with complete list: "5, 6, 7, 8, 9".
This format is more consistent with the surrounding examples.

6 years agobpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010)
Alexey Izbyshev [Thu, 8 Mar 2018 16:03:25 +0000 (19:03 +0300)]
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010)

6 years agoAdd two missing error checks in hamt.c (GH-5851)
Xiang Zhang [Thu, 8 Mar 2018 05:59:46 +0000 (13:59 +0800)]
Add two missing error checks in hamt.c (GH-5851)

6 years agoFix some ipaddress documentation errors (GH-6021)
Xiang Zhang [Thu, 8 Mar 2018 04:24:36 +0000 (12:24 +0800)]
Fix some ipaddress documentation errors (GH-6021)

* fix a typo: documention -> documentation
* fix the type of IPv?Network.hostmask
* add documentation about IPv?Network.netmask
* fix IPv6Network constructor doc that extended netmasks are not supported

6 years agobpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)
INADA Naoki [Wed, 7 Mar 2018 07:27:01 +0000 (16:27 +0900)]
bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)

6 years agobpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
Xiang Zhang [Wed, 7 Mar 2018 05:05:37 +0000 (13:05 +0800)]
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)

6 years agobpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
Yury Selivanov [Tue, 6 Mar 2018 17:59:45 +0000 (12:59 -0500)]
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)

6 years agobpo-33005: Fix _PyGILState_Reinit() (#6001)
Victor Stinner [Tue, 6 Mar 2018 13:31:37 +0000 (14:31 +0100)]
bpo-33005: Fix _PyGILState_Reinit() (#6001)

Fix a crash on fork when using a custom memory allocator (ex: using
PYTHONMALLOC env var).

_PyGILState_Reinit() and _PyInterpreterState_Enable() now use the
default RAW memory allocator to allocate a new interpreters mutex on
fork.

6 years agoFix strncpy warning with gcc 8 (#5840)
Siddhesh Poyarekar [Tue, 6 Mar 2018 10:34:35 +0000 (16:04 +0530)]
Fix strncpy warning with gcc 8 (#5840)

The length in strncpy is one char too short and as a result it leads
to a build warning with gcc 8.  Comment out the strncpy since the
interpreter aborts immediately after anyway.

6 years agobpo-32991: Restore expectation that inspect.getfile raises TypeError on namespace...
Jason R. Coombs [Mon, 5 Mar 2018 23:29:08 +0000 (18:29 -0500)]
bpo-32991: Restore expectation that inspect.getfile raises TypeError on namespace package (GH-5980)

* bpo-32991: Add test capturing expectation.

DocTestFinder.find should return an empty list for doctests in a namespace package.

* bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.