]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)
Victor Stinner [Wed, 29 Jan 2020 14:23:29 +0000 (15:23 +0100)] 
bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)

XFS filesystem is limited to 32-bit timestamp, but the utimensat()
syscall doesn't fail. Moreover, there is a VFS bug which returns
a cached timestamp which is different than the value on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1795576
https://bugs.python.org/issue39460#msg360952

5 years agoDoc: Fix external links to functional programming tutorial. (GH-18249)
Julien Palard [Wed, 29 Jan 2020 13:10:54 +0000 (14:10 +0100)] 
Doc: Fix external links to functional programming tutorial. (GH-18249)

5 years agobpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)
Joannah Nanjekye [Wed, 29 Jan 2020 11:20:53 +0000 (07:20 -0400)] 
bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)

Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* đŸ“œđŸ€– Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-36051: Drop GIL during large bytes.join() (GH-17757)
Bruce Merry [Wed, 29 Jan 2020 07:09:24 +0000 (09:09 +0200)] 
bpo-36051: Drop GIL during large bytes.join() (GH-17757)

Improve multi-threaded performance by dropping the GIL in the fast path
of bytes.join. To avoid increasing overhead for small joins, it is only
done if the output size exceeds a threshold.

5 years agobpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231)
Steve Dower [Wed, 29 Jan 2020 02:46:33 +0000 (13:46 +1100)] 
bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231)

As Windows 7 is not supported by Python 3.9, we just replace the dynamic load with a static import. Backports will have a different fix to ensure they continue to behave the same.

5 years agobpo-39459: include missing test files in windows installer
Dino Viehland [Tue, 28 Jan 2020 21:24:12 +0000 (13:24 -0800)] 
bpo-39459: include missing test files in windows installer

Adds missing test files to Windows installer to wrap up bpo-39459

5 years agobpo-38960: DTrace build fix for FreeBSD. (GH-17451)
David Carlier [Tue, 28 Jan 2020 12:53:32 +0000 (12:53 +0000)] 
bpo-38960: DTrace build fix for FreeBSD. (GH-17451)

DTrace build fix for FreeBSD.

- allowing passing an extra flag as it need to define the arch size.
- casting some probe's arguments.

5 years agobpo-36350: inspect: Replace OrderedDict with dict. (GH-12412)
RĂ©mi Lapeyre [Tue, 28 Jan 2020 12:47:03 +0000 (13:47 +0100)] 
bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412)

5 years agobpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
Adam Meily [Tue, 28 Jan 2020 10:34:23 +0000 (05:34 -0500)] 
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)

5 years agobpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
Inada Naoki [Tue, 28 Jan 2020 10:12:31 +0000 (19:12 +0900)] 
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
5 years agobpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)
Zackery Spytz [Tue, 28 Jan 2020 09:42:43 +0000 (02:42 -0700)] 
bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)

5 years agobpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows ...
Christoph Reiter [Tue, 28 Jan 2020 09:41:50 +0000 (10:41 +0100)] 
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows (GH-17961)

In bpo-36264 os.path.expanduser was changed to ignore HOME on Windows.

Path.expanduser/home still honored HOME despite being documented as behaving the same
as os.path.expanduser. This makes them also ignore HOME so that both implementations
behave the same way again.

5 years agobpo-38644: Pass tstate in ceval.c (GH-18222)
Victor Stinner [Tue, 28 Jan 2020 02:37:45 +0000 (03:37 +0100)] 
bpo-38644: Pass tstate in ceval.c (GH-18222)

Pass explicitly the Python thread state (tstate) in ceval.c.

5 years agobpo-36018: Minor fixes to the NormalDist() examples and recipes. (GH-18226)
Raymond Hettinger [Tue, 28 Jan 2020 02:31:46 +0000 (18:31 -0800)] 
bpo-36018: Minor fixes to the NormalDist() examples and recipes. (GH-18226)

* Change the source for the SAT data to a primary source.
* Fix typo in the standard deviation
* Clarify that the binomial probabalities are just for the Python room.

5 years agobpo-39205: Tests that highlight a hang on ProcessPoolExecutor shutdown (#18221)
Brian Quinlan [Tue, 28 Jan 2020 00:50:37 +0000 (16:50 -0800)] 
bpo-39205: Tests that highlight a hang on ProcessPoolExecutor shutdown (#18221)

5 years agobpo-39392: Turtle overlap fill depends on OS (#18223)
Terry Jan Reedy [Mon, 27 Jan 2020 23:41:18 +0000 (18:41 -0500)] 
bpo-39392: Turtle overlap fill depends on OS (#18223)

Whether or not overlap regions for self-intersecting polygons
or multiple shapes are filled depends on the operating system graphics,
typeof overlap, and number of overlaps.

5 years agobpo-38631: Avoid Py_FatalError() in PyCode_New() (GH-18215)
Victor Stinner [Mon, 27 Jan 2020 22:24:13 +0000 (23:24 +0100)] 
bpo-38631: Avoid Py_FatalError() in PyCode_New() (GH-18215)

intern_strings() now raises a SystemError, rather than calling
Py_FatalError().

intern_string_constants() now reports exceptions to the caller,
rather than ignoring silently exceptions.

5 years agobpo-38631: Avoid Py_FatalError() in _PyCodecRegistry_Init() (GH-18217)
Victor Stinner [Mon, 27 Jan 2020 22:23:12 +0000 (23:23 +0100)] 
bpo-38631: Avoid Py_FatalError() in _PyCodecRegistry_Init() (GH-18217)

_PyCodecRegistry_Init() now reports exceptions to the caller,
rather than calling Py_FatalError().

5 years agobpo-30780: Add IDLE configdialog tests (#3592)
Cheryl Sabella [Mon, 27 Jan 2020 22:15:56 +0000 (17:15 -0500)] 
bpo-30780: Add IDLE configdialog tests (#3592)

Expose dialog buttons to test code and complete their test coverage.
Complete test coverage for highlights and keys tabs.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agoAdd test.test_import.data.unwritable package to makefile (#18211)
Dino Viehland [Mon, 27 Jan 2020 22:04:56 +0000 (14:04 -0800)] 
Add test.test_import.data.unwritable package to makefile (#18211)

5 years agobpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214)
Victor Stinner [Mon, 27 Jan 2020 21:37:44 +0000 (22:37 +0100)] 
bpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214)

If the export count is negative, _memory_release() now raises a
SystemError and returns -1, rather than calling Py_FatalError()
which aborts the process.

5 years agobpo-38631: Avoid Py_FatalError() in PyModule_Create2() (GH-18212)
Victor Stinner [Mon, 27 Jan 2020 21:37:05 +0000 (22:37 +0100)] 
bpo-38631: Avoid Py_FatalError() in PyModule_Create2() (GH-18212)

If PyModule_Create2() is called when the Python import machinery is
not initialized, it now raises a SystemError and returns NULL,
instead of calling Py_FatalError() which aborts the process.

The caller must be prepared to handle NULL anyway.

5 years agobpo-39459: test.pythoninfo logs effective uid/gid (GH-18203)
Victor Stinner [Mon, 27 Jan 2020 17:06:42 +0000 (18:06 +0100)] 
bpo-39459: test.pythoninfo logs effective uid/gid (GH-18203)

Fix also umask formatting: use octal prefix.

5 years agobpo-39453: Add testcase for bpo-39453 (GH-18202)
Dong-hee Na [Mon, 27 Jan 2020 17:04:25 +0000 (02:04 +0900)] 
bpo-39453: Add testcase for bpo-39453 (GH-18202)

https://bugs.python.org/issue39453

Automerge-Triggered-By: @pablogsal
Automerge-Triggered-By: @pablogsal
5 years agoIgnore NEWS snippets in code coverage stats (GH-18194)
Nick Coghlan [Mon, 27 Jan 2020 16:05:03 +0000 (02:05 +1000)] 
Ignore NEWS snippets in code coverage stats (GH-18194)

5 years agobpo-39453: Make list.__contains__ hold strong references to avoid crashes (GH-18181)
Dong-hee Na [Mon, 27 Jan 2020 15:02:23 +0000 (00:02 +0900)] 
bpo-39453: Make list.__contains__ hold strong references to avoid crashes (GH-18181)

5 years agoClarify and fix assertions that mocks have not been awaited (GH-18196)
Chris Withers [Mon, 27 Jan 2020 14:55:56 +0000 (14:55 +0000)] 
Clarify and fix assertions that mocks have not been awaited (GH-18196)

- The gc.collect is needed for other implementations, such as pypy
- Using context managers over multiple lines will only catch the warning from the first line in the context!
- remove a skip for a test that no longer fails on pypy

5 years agoUse relative imports in mock and its tests to help backporting (GH-18197)
Chris Withers [Mon, 27 Jan 2020 14:11:19 +0000 (14:11 +0000)] 
Use relative imports in mock and its tests to help backporting (GH-18197)

* asyncio.run only available in 3.8+

* iscoroutinefunction has important bungfixes in 3.8

* IsolatedAsyncioTestCase only available in 3.8+

5 years agoFix so that test.test_distutils can be executed by unittest and not just regrtest...
Toshio Kuratomi [Mon, 27 Jan 2020 12:08:39 +0000 (04:08 -0800)] 
Fix so that test.test_distutils can be executed by unittest and not just regrtest (GH-13480)

5 years agobpo-39320: Handle unpacking of **values in compiler (GH-18141)
Mark Shannon [Mon, 27 Jan 2020 09:57:45 +0000 (09:57 +0000)] 
bpo-39320: Handle unpacking of **values in compiler (GH-18141)

* Add DICT_UPDATE and DICT_MERGE bytecodes. Use them for ** unpacking.

* Remove BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL, as they are now unused.

* Update magic number for ** unpacking opcodes.

* Update dis.rst to incorporate new bytecodes.

* Add blurb entry.

5 years agobpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)
Karthikeyan Singaravelan [Mon, 27 Jan 2020 06:48:15 +0000 (12:18 +0530)] 
bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)

5 years agobpo-36018: Add another example for NormalDist() (#18191)
Raymond Hettinger [Sun, 26 Jan 2020 04:21:17 +0000 (20:21 -0800)] 
bpo-36018: Add another example for NormalDist() (#18191)

5 years agoFix linecache.py add lazycache to __all__ and use dict.clear to clear the cache ...
抠撌 [Sun, 26 Jan 2020 02:07:40 +0000 (10:07 +0800)] 
Fix linecache.py add lazycache to __all__ and use dict.clear to clear the cache (GH-4641)

5 years agobpo-39374: Updated sorting documentation (GH-18177)
Juhana Jauhiainen [Sat, 25 Jan 2020 22:18:58 +0000 (00:18 +0200)] 
bpo-39374: Updated sorting documentation (GH-18177)

5 years agobpo-36654: Add examples for using tokenize module programmically (#12947)
Windson yang [Sat, 25 Jan 2020 19:23:00 +0000 (03:23 +0800)] 
bpo-36654: Add examples for using tokenize module programmically (#12947)

5 years agobpo-15243: Document __prepare__ as classmethod (GH-17124)
alclarks [Sat, 25 Jan 2020 18:49:58 +0000 (18:49 +0000)] 
bpo-15243: Document __prepare__ as classmethod (GH-17124)

5 years agobpo-38932: Mock fully resets child objects on reset_mock(). (GH-17409)
Vegard Stikbakke [Sat, 25 Jan 2020 15:44:46 +0000 (16:44 +0100)] 
bpo-38932: Mock fully resets child objects on reset_mock(). (GH-17409)

5 years agoUpdate 3.8.rst (GH-18173)
fireattack [Sat, 25 Jan 2020 15:08:13 +0000 (09:08 -0600)] 
Update 3.8.rst (GH-18173)

Fixed the name of the contributor (@selik).

5 years agoPost 3.9.0a3
Ɓukasz Langa [Sat, 25 Jan 2020 13:52:44 +0000 (14:52 +0100)] 
Post 3.9.0a3

5 years agoMerge tag 'v3.9.0a3'
Ɓukasz Langa [Sat, 25 Jan 2020 13:52:06 +0000 (14:52 +0100)] 
Merge tag 'v3.9.0a3'

Python 3.9.0a3

5 years agobpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)
Paulo Henrique Silva [Sat, 25 Jan 2020 10:53:54 +0000 (07:53 -0300)] 
bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)

5 years agobpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18116)
Matthew Kokotovich [Sat, 25 Jan 2020 10:17:47 +0000 (04:17 -0600)] 
bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18116)

5 years agobpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)
Cheryl Sabella [Sat, 25 Jan 2020 09:00:54 +0000 (04:00 -0500)] 
bpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agoPython 3.9.0a3 v3.9.0a3
Ɓukasz Langa [Fri, 24 Jan 2020 21:05:07 +0000 (22:05 +0100)] 
Python 3.9.0a3

5 years agobpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)
Serhiy Storchaka [Fri, 24 Jan 2020 17:55:52 +0000 (19:55 +0200)] 
bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)

Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.

5 years agobpo-38631: Avoid Py_FatalError() in GC collect() (GH-18164)
Victor Stinner [Fri, 24 Jan 2020 17:05:24 +0000 (18:05 +0100)] 
bpo-38631: Avoid Py_FatalError() in GC collect() (GH-18164)

collect() should not get an exception, but it does, logging the
exception is enough. Override sys.unraisablehook to decide how to
handle unraisable exceptions.

Py_FatalError() should be avoided whenever possible.

5 years agobpo-39390 shutil: fix argument types for ignore callback (GH-18122)
mbarkhau [Fri, 24 Jan 2020 14:51:16 +0000 (14:51 +0000)] 
bpo-39390 shutil: fix argument types for ignore callback (GH-18122)

5 years agobpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784)
Karthikeyan Singaravelan [Fri, 24 Jan 2020 13:14:29 +0000 (18:44 +0530)] 
bpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784)

5 years agobpo-39395: putenv() and unsetenv() always available (GH-18135)
Victor Stinner [Fri, 24 Jan 2020 13:05:48 +0000 (14:05 +0100)] 
bpo-39395: putenv() and unsetenv() always available (GH-18135)

The os.putenv() and os.unsetenv() functions are now always available.

On non-Windows platforms, Python now requires setenv() and unsetenv()
functions to build.

Remove putenv_dict from posixmodule.c: it's not longer needed.

5 years agobpo-39413: Implement os.unsetenv() on Windows (GH-18163)
Victor Stinner [Fri, 24 Jan 2020 10:53:44 +0000 (11:53 +0100)] 
bpo-39413: Implement os.unsetenv() on Windows (GH-18163)

The os.unsetenv() function is now also available on Windows.

5 years agobpo-39361: Document the removal of PyTypeObject.tp_print (GH-18125)
Ammar Askar [Fri, 24 Jan 2020 10:35:01 +0000 (05:35 -0500)] 
bpo-39361: Document the removal of PyTypeObject.tp_print (GH-18125)

5 years agobpo-39426: Fix outdated default and highest protocols in docs (GH-18154)
Mark Dickinson [Fri, 24 Jan 2020 10:03:22 +0000 (10:03 +0000)] 
bpo-39426: Fix outdated default and highest protocols in docs (GH-18154)

Some portions of the pickle documentation hadn't been updated for the pickle protocol changes in Python 3.8 (new protocol 5, default protocol 4). This PR fixes those docs.

https://bugs.python.org/issue39426

5 years agobpo-39429: Add a new "Python Development Mode" doc page (GH-18132)
Victor Stinner [Fri, 24 Jan 2020 09:22:18 +0000 (10:22 +0100)] 
bpo-39429: Add a new "Python Development Mode" doc page (GH-18132)

5 years agoFix `mock.patch.dict` to be stopped with `mock.patch.stopall` (#17606)
Mario Corchero [Fri, 24 Jan 2020 08:38:33 +0000 (08:38 +0000)] 
Fix `mock.patch.dict` to be stopped with `mock.patch.stopall` (#17606)

As the function was not registering in the active patches, the mocks
started by `mock.patch.dict` were not being stopped when
`mock.patch.stopall` was being called.

5 years agobpo-24928: Add test case for patch.dict using OrderedDict (GH -11437)
Emmanuel Arias [Fri, 24 Jan 2020 08:14:14 +0000 (05:14 -0300)] 
bpo-24928: Add test case for patch.dict using OrderedDict (GH -11437)

* add test for path.dict using OrderedDict

Co-authored-by: Yu Tomita nekobon@users.noreply.github.com
5 years agobpo-17005: Minor improvements to the documentation of TopologicalSorter (GH-18155)
Pablo Galindo [Thu, 23 Jan 2020 21:01:50 +0000 (21:01 +0000)] 
bpo-17005: Minor improvements to the documentation of TopologicalSorter (GH-18155)

5 years agobpo-39431: Also mention nonlocal in assignment quirk (GH-17375)
Shanavas M [Thu, 23 Jan 2020 18:09:21 +0000 (23:39 +0530)] 
bpo-39431: Also mention nonlocal in assignment quirk (GH-17375)

5 years agobpo-17005: Add a class to perform topological sorting to the standard library (GH...
Pablo Galindo [Thu, 23 Jan 2020 15:29:52 +0000 (15:29 +0000)] 
bpo-17005: Add a class to perform topological sorting to the standard library (GH-11583)

Co-Authored-By: Tim Peters <tim.peters@gmail.com>
5 years agobpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)
Pablo Galindo [Thu, 23 Jan 2020 14:07:05 +0000 (14:07 +0000)] 
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)

* bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

5 years agobpo-39320: Handle unpacking of *values in compiler (GH-17984)
Mark Shannon [Thu, 23 Jan 2020 09:25:17 +0000 (09:25 +0000)] 
bpo-39320: Handle unpacking of *values in compiler (GH-17984)

* Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions.

* Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and  BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused.

* Update magic number and dis.rst for new bytecodes.

5 years agobpo-32989: IDLE - remove unneeded parameter (GH-18138)
Terry Jan Reedy [Thu, 23 Jan 2020 04:55:07 +0000 (23:55 -0500)] 
bpo-32989: IDLE - remove unneeded parameter  (GH-18138)

IDLE does not pass a non-default _synchre in any of its calls to
pyparse.find_good_parse_start.

5 years agobpo-39050: The Help button in IDLE's config menu works again (GH-17611)
Zackery Spytz [Thu, 23 Jan 2020 03:54:30 +0000 (20:54 -0700)] 
bpo-39050: The Help button in IDLE's config menu works again (GH-17611)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)
William Woodruff [Thu, 23 Jan 2020 02:24:16 +0000 (21:24 -0500)] 
bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)

`is_tarfile()` now supports `name` being a file or file-like object.

5 years agobpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131)
Pablo Galindo [Thu, 23 Jan 2020 01:03:04 +0000 (01:03 +0000)] 
bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131)

https://bugs.python.org/issue39427

Automerge-Triggered-By: @pablogsal
5 years agobpo-39336: Allow packages to not let their child modules be set on them (#18006)
Dino Viehland [Thu, 23 Jan 2020 00:42:38 +0000 (16:42 -0800)] 
bpo-39336: Allow packages to not let their child modules be set on them (#18006)

* bpo-39336: Allow setattr to fail on modules which aren't assignable

When attaching a child module to a package if the object in sys.modules raises an AttributeError (e.g. because it is immutable) it causes the whole import to fail.  This now allows immutable packages to exist and an ImportWarning is reported and the AttributeError exception is ignored.

5 years agobpo-35182: fix communicate() crash after child closes its pipes (GH-17020) (GH-18117)
Alex Rebert [Wed, 22 Jan 2020 23:28:31 +0000 (18:28 -0500)] 
bpo-35182: fix communicate() crash after child closes its pipes (GH-17020) (GH-18117)

When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>
5 years agobpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035)
Dong-hee Na [Wed, 22 Jan 2020 21:59:43 +0000 (06:59 +0900)] 
bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035)

5 years agobpo-39406: Implement os.putenv() with setenv() if available (GH-18128)
Victor Stinner [Wed, 22 Jan 2020 21:48:16 +0000 (22:48 +0100)] 
bpo-39406: Implement os.putenv() with setenv() if available (GH-18128)

If setenv() C function is available, os.putenv() is now implemented
with setenv() instead of putenv(), so Python doesn't have to handle
the environment variable memory.

5 years agobpo-39406: os.putenv() avoids putenv_dict on Windows (GH-18126)
Victor Stinner [Wed, 22 Jan 2020 20:53:26 +0000 (21:53 +0100)] 
bpo-39406: os.putenv() avoids putenv_dict on Windows (GH-18126)

Windows: _wputenv(env) copies the *env* string and doesn't require
the caller to manage the variable memory.

5 years agoRevert "bpo-39413: Implement os.unsetenv() on Windows (GH-18104)" (GH-18124)
Victor Stinner [Wed, 22 Jan 2020 20:11:17 +0000 (21:11 +0100)] 
Revert "bpo-39413: Implement os.unsetenv() on Windows (GH-18104)" (GH-18124)

This reverts commit 56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.

5 years agobpo-39353: Deprecate the binhex module (GH-18025)
Victor Stinner [Wed, 22 Jan 2020 19:44:22 +0000 (20:44 +0100)] 
bpo-39353: Deprecate the binhex module (GH-18025)

Deprecate binhex4 and hexbin4 standards. Deprecate the binhex module
and the following binascii functions:

* b2a_hqx(), a2b_hqx()
* rlecode_hqx(), rledecode_hqx()
* crc_hqx()

5 years agobpo-39425: Fix list.count performance regression (GH-18119)
Dong-hee Na [Wed, 22 Jan 2020 17:36:54 +0000 (02:36 +0900)] 
bpo-39425: Fix list.count performance regression (GH-18119)

https://bugs.python.org/issue39425

Automerge-Triggered-By: @pablogsal
5 years agobpo-39377: json: Update doc about the encoding option. (GH-18076)
Inada Naoki [Wed, 22 Jan 2020 10:01:24 +0000 (19:01 +0900)] 
bpo-39377: json: Update doc about the encoding option. (GH-18076)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agocloses bpo-39415: Remove unused codes from longobject.c complexobject.c floatobject...
Dong-hee Na [Wed, 22 Jan 2020 02:49:30 +0000 (11:49 +0900)] 
closes bpo-39415: Remove unused codes from longobject.c complexobject.c floatobject.c. (GH-18105)

5 years agoPyLong_AsLongLong() docs should say 'long long' (#18082)
Keith Erskine [Tue, 21 Jan 2020 19:14:13 +0000 (13:14 -0600)] 
PyLong_AsLongLong() docs should say 'long long' (#18082)

5 years agobpo-39406: Add PY_PUTENV_DICT macro to posixmodule.c (GH-18106)
Victor Stinner [Tue, 21 Jan 2020 18:25:32 +0000 (19:25 +0100)] 
bpo-39406: Add PY_PUTENV_DICT macro to posixmodule.c (GH-18106)

Rename posix_putenv_garbage to putenv_dict.

5 years agobpo-39413: Implement os.unsetenv() on Windows (GH-18104)
Victor Stinner [Tue, 21 Jan 2020 15:13:09 +0000 (16:13 +0100)] 
bpo-39413: Implement os.unsetenv() on Windows (GH-18104)

The os.unsetenv() function is now also available on Windows.

It is implemented with SetEnvironmentVariableW(name, NULL).

5 years agoMove test_math tests (GH-18098)
Victor Stinner [Tue, 21 Jan 2020 11:48:16 +0000 (12:48 +0100)] 
Move test_math tests (GH-18098)

testPerm() and testComb() belong to MathTests, not to IsCloseTests().

test_nextafter() and test_ulp() now use assertIsNaN().

5 years agobpo-33387: Fix compiler warning in frame_block_unwind() (GH-18099)
Victor Stinner [Tue, 21 Jan 2020 11:47:29 +0000 (12:47 +0100)] 
bpo-33387: Fix compiler warning in frame_block_unwind() (GH-18099)

Replace int with intptr_t to fix the warning:

    objects\frameobject.c(341): warning C4244: 'initializing':
    conversion from '__int64' to 'int', possible loss of data

5 years agobpo-39389: gzip: fix compression level metadata (GH-18077)
William Chargin [Tue, 21 Jan 2020 11:25:24 +0000 (03:25 -0800)] 
bpo-39389: gzip: fix compression level metadata (GH-18077)

As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a
gzip member header should indicate whether the DEFLATE algorithm was
tuned for speed or compression ratio. Prior to this patch, archives
emitted by the `gzip` module always indicated maximum compression.

5 years agobpo-39396: Fix math.nextafter(-0.0, +0.0) on AIX 7.1 (GH-18094)
Victor Stinner [Tue, 21 Jan 2020 10:14:10 +0000 (11:14 +0100)] 
bpo-39396: Fix math.nextafter(-0.0, +0.0) on AIX 7.1 (GH-18094)

Move also math.nextafter() on math.ulp() tests from IsCloseTests to
MathTests.

5 years agobpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)
Cheryl Sabella [Tue, 21 Jan 2020 10:11:26 +0000 (05:11 -0500)] 
bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)

Fix comments and add tests for editor newline_and_indent_event method.
Remove unused None default for function parameter of pyparse find_good_parse_start method
and code triggered by that default.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agoimprove the documentation of the LOAD_METHOD and CALL_METHOD (GH-18079)
Carl Friedrich Bolz-Tereick [Tue, 21 Jan 2020 00:41:17 +0000 (01:41 +0100)] 
improve the documentation of the LOAD_METHOD and CALL_METHOD (GH-18079)

5 years agobpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)
Peter Bittner [Mon, 20 Jan 2020 23:22:56 +0000 (00:22 +0100)] 
bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)

5 years agobpo-39386: Prevent double awaiting of async iterator (GH-18081)
Andrew Svetlov [Mon, 20 Jan 2020 22:49:30 +0000 (00:49 +0200)] 
bpo-39386: Prevent double awaiting of async iterator (GH-18081)

5 years agoFix asyncio.get_event_loop() documentation (GH-18051)
Andrew Svetlov [Mon, 20 Jan 2020 22:46:38 +0000 (00:46 +0200)] 
Fix asyncio.get_event_loop() documentation (GH-18051)

Mention that the function implicitly creates new event loop only if called from the main thread.

5 years agobpo-35134: Migrate frameobject.h contents to cpython/frameobject.h (GH-18052)
Nick Coghlan [Mon, 20 Jan 2020 22:21:35 +0000 (08:21 +1000)] 
bpo-35134: Migrate frameobject.h contents to cpython/frameobject.h (GH-18052)

5 years agobpo-39377: json: Remove the encoding option. (GH-18075)
Inada Naoki [Mon, 20 Jan 2020 04:54:00 +0000 (13:54 +0900)] 
bpo-39377: json: Remove the encoding option. (GH-18075)

5 years agobpo-38536: locale: Remove trailing space in formatted currency (GH-16864)
Inada Naoki [Mon, 20 Jan 2020 03:45:50 +0000 (12:45 +0900)] 
bpo-38536: locale: Remove trailing space in formatted currency (GH-16864)

5 years agobpo-35561: Supress valgrind false alarm on epoll_ctl(event) (GH-18060)
Zackery Spytz [Sun, 19 Jan 2020 22:38:37 +0000 (15:38 -0700)] 
bpo-35561: Supress valgrind false alarm on epoll_ctl(event) (GH-18060)

Update Misc/valgrind-python.supp to suppress the false alarm.

5 years agoFix typo from base to based (GH-18055)
Michael Haas [Sun, 19 Jan 2020 10:29:42 +0000 (04:29 -0600)] 
Fix typo from base to based (GH-18055)

5 years agobpo-39372: Clean header files of declared interfaces with no implementations (GH...
Pablo Galindo [Sat, 18 Jan 2020 03:14:59 +0000 (03:14 +0000)] 
bpo-39372: Clean header files of declared interfaces with no implementations (GH-18037)

The public API symbols being removed are:

_PyBytes_InsertThousandsGroupingLocale, _PyBytes_InsertThousandsGrouping, _Py_InitializeFromArgs, _Py_InitializeFromWideArgs, _PyFloat_Repr, _PyFloat_Digits,
_PyFloat_DigitsInit, PyFrame_ExtendStack, _PyAIterWrapper_Type, PyNullImporter_Type, PyCmpWrapper_Type, PySortWrapper_Type, PyNoArgsFunction.

5 years agoRun doctests in GitHub actions Docs targer (GH-18041)
Pablo Galindo [Fri, 17 Jan 2020 23:44:38 +0000 (23:44 +0000)] 
Run doctests in GitHub actions Docs targer (GH-18041)

5 years agoFix Lock.locked() to remove extra bold highlighting (#18042)
Grant Jenks [Fri, 17 Jan 2020 22:54:44 +0000 (14:54 -0800)] 
Fix Lock.locked() to remove extra bold highlighting (#18042)

5 years agobpo-39356, zipfile: Remove code handling DeprecationWarning (GH-18027)
Victor Stinner [Fri, 17 Jan 2020 14:17:48 +0000 (15:17 +0100)] 
bpo-39356, zipfile: Remove code handling DeprecationWarning (GH-18027)

Remove old "except DeprecationWarning:" code path added by
commit bf02e3bb21b2d75cba4ce409a14ae64dbc2dd6d2. It's no longer
needed.

struct.pack() no longer emit DeprecationWarning if getting a float
whereas an integer is expected. It now raises an hard error instead.

5 years agobpo-39357: Update bz2 docstring: remove buffering (GH-18036)
Victor Stinner [Fri, 17 Jan 2020 12:50:39 +0000 (13:50 +0100)] 
bpo-39357: Update bz2 docstring: remove buffering (GH-18036)

Thanks Karthikeyan Singaravelan for the report ;-)

5 years agobpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)
Victor Stinner [Thu, 16 Jan 2020 14:33:30 +0000 (15:33 +0100)] 
bpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)

Remove the buffering parameter of bz2.BZ2File. Since Python 3.0, it
was ignored and using it was emitting a DeprecationWarning. Pass an
open file object to control how the file is opened.

The compresslevel parameter becomes keyword-only.

5 years agobpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)
Niklas Fiekas [Thu, 16 Jan 2020 14:09:19 +0000 (15:09 +0100)] 
bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)

Add _Py_bit_length() to unify duplicate bits_in_digit() and bit_length().

5 years agobpo-39350: Remove deprecated fractions.gcd() (GH-18021)
Victor Stinner [Thu, 16 Jan 2020 10:02:51 +0000 (11:02 +0100)] 
bpo-39350: Remove deprecated fractions.gcd() (GH-18021)

Remove fractions.gcd() function, deprecated since Python 3.5
(bpo-22486): use math.gcd() instead.

5 years agobpo-39351: Remove base64.encodestring() (GH-18022)
Victor Stinner [Thu, 16 Jan 2020 09:24:16 +0000 (10:24 +0100)] 
bpo-39351: Remove base64.encodestring() (GH-18022)

Remove base64.encodestring() and base64.decodestring(), aliases
deprecated since Python 3.1: use base64.encodebytes() and
base64.decodebytes() instead.