]> granicus.if.org Git - python/log
python
4 years agoTypo fix - implemention should be implementation (GH-16806)
Hansraj Das [Tue, 15 Oct 2019 20:49:13 +0000 (02:19 +0530)]
Typo fix - implemention should be implementation (GH-16806)

4 years agobpo-38468 : Refactor python-config (#16749)
Joannah Nanjekye [Tue, 15 Oct 2019 14:18:47 +0000 (11:18 -0300)]
bpo-38468 : Refactor python-config (#16749)

* refactor python-config

* ðŸ“œðŸ¤– Added by blurb_it.

* Update Misc/NEWS.d/next/Build/2019-10-13-16-18-24.bpo-38468.buCO84.rst

Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
* Use getvar for pyver

* Update news entry with affected file.

* Update Misc/NEWS.d/next/Build/2019-10-13-16-18-24.bpo-38468.buCO84.rst

Co-Authored-By: Victor Stinner <vstinner@python.org>
* Update 2019-10-13-16-18-24.bpo-38468.buCO84.rst

4 years agobpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545)
Julien Danjou [Tue, 15 Oct 2019 12:00:16 +0000 (14:00 +0200)]
bpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545)

Add a total_nframe field to the traces collected by the tracemalloc module.
This field indicates the original number of frames before it was truncated.

4 years agobpo-38478: Correctly handle keyword argument with same name as positional-only parame...
Pablo Galindo [Tue, 15 Oct 2019 11:40:02 +0000 (12:40 +0100)]
bpo-38478: Correctly handle keyword argument with same name as positional-only parameter (GH-16800)

4 years agobpo-38470: Fix test_compileall.test_compile_dir_maxlevels() (GH-16789)
Victor Stinner [Tue, 15 Oct 2019 09:26:13 +0000 (11:26 +0200)]
bpo-38470: Fix test_compileall.test_compile_dir_maxlevels() (GH-16789)

Fix test_compile_dir_maxlevels() on Windows without long path
support: only create 3 subdirectories instead of between 20 and 100
subdirectories.

Fix also compile_dir() to use the current sys.getrecursionlimit()
value as the default maxlevels value, rather than using
sys.getrecursionlimit() value read at startup.

4 years agobpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows...
Vinay Sajip [Tue, 15 Oct 2019 07:26:12 +0000 (08:26 +0100)]
bpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows. (GH-16347)

4 years agobpo-38133: Update docs to reflect fixes to py.exe launcher (GH-16791)
Steve Dower [Mon, 14 Oct 2019 22:45:43 +0000 (15:45 -0700)]
bpo-38133: Update docs to reflect fixes to py.exe launcher (GH-16791)

4 years agoDoc: 3.8 is now stable. (GH-16790)
Julien Palard [Mon, 14 Oct 2019 22:13:38 +0000 (00:13 +0200)]
Doc: 3.8 is now stable. (GH-16790)

4 years agoRemove draft status. Add asyncio REPL example (GH-16785)
Raymond Hettinger [Mon, 14 Oct 2019 16:01:05 +0000 (09:01 -0700)]
Remove draft status.  Add asyncio REPL example (GH-16785)

4 years agobpo-38453: Resolve test directories before chdir to them (GH-16723)
Steve Dower [Mon, 14 Oct 2019 15:42:21 +0000 (08:42 -0700)]
bpo-38453: Resolve test directories before chdir to them (GH-16723)

4 years agobpo-37759: Polish What's New in Python 3.8. (#16769)
Serhiy Storchaka [Mon, 14 Oct 2019 13:10:40 +0000 (16:10 +0300)]
bpo-37759: Polish What's New in Python 3.8. (#16769)

4 years agoUpdate build docs for macOS (GH-16771)
Ned Deily [Mon, 14 Oct 2019 12:16:10 +0000 (08:16 -0400)]
Update build docs for macOS (GH-16771)

4 years agobpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)
Stein Karlsen [Mon, 14 Oct 2019 10:36:29 +0000 (12:36 +0200)]
bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)

4 years agoUpdate macOS installer display files for 3.9.0a1 (GH-16765)
Ned Deily [Mon, 14 Oct 2019 08:26:45 +0000 (04:26 -0400)]
Update macOS installer display files for 3.9.0a1 (GH-16765)

4 years agobpo-37759: Add examples for the new typing features (GH-16763)
Raymond Hettinger [Mon, 14 Oct 2019 06:32:03 +0000 (23:32 -0700)]
bpo-37759: Add examples for the new typing features (GH-16763)

4 years agobpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761)
Raymond Hettinger [Mon, 14 Oct 2019 04:31:12 +0000 (21:31 -0700)]
bpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761)

* bpo-38461: ncurses misspelled as curses

* bpo-38463: Fix broken link

4 years agobpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755)
Pablo Galindo [Mon, 14 Oct 2019 04:18:05 +0000 (05:18 +0100)]
bpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755)

The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.

4 years agobpo-38464: Document parameter for NormalDist.quantiles() (GH-16757)
Raymond Hettinger [Mon, 14 Oct 2019 02:53:30 +0000 (19:53 -0700)]
bpo-38464: Document parameter for NormalDist.quantiles() (GH-16757)

4 years agoMisc gc code & comment cleanups. (GH-16752)
Tim Peters [Sun, 13 Oct 2019 21:47:04 +0000 (16:47 -0500)]
Misc gc code & comment cleanups. (GH-16752)

* Misc gc code & comment cleanups.

validate_list:  there are two temp flags polluting pointers, but this checked only one.  Now it checks both, and verifies that the list head's pointers are not polluted.

move_unreachable: repaired incoherent comments.  Added new comments.  Cleared the pollution of the unreachable list head's 'next' pointer (it was expedient while the function was running, but there's no excuse for letting this damage survive the function's end).

* Update Modules/gcmodule.c

Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
4 years agobpo-38467: Fix argument name of typing functions (GH-16753)
Sebastian Rittau [Sun, 13 Oct 2019 18:31:35 +0000 (20:31 +0200)]
bpo-38467: Fix argument name of typing functions (GH-16753)

4 years agobpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)
Ivan Levkivskyi [Sun, 13 Oct 2019 16:53:06 +0000 (17:53 +0100)]
bpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)

Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this).

https://bugs.python.org/issue28556

4 years agoRebased version of what's new PR (#16745)
Andrew Kuchling [Sun, 13 Oct 2019 15:51:36 +0000 (11:51 -0400)]
Rebased version of what's new PR (#16745)

* Use Unicode character for accent
* Various grammar fixes
* Sort library modules alphabetically; remove duplicated idlelib/IDLE section

4 years agobpo-38379: Don't block collection of unreachable objects when some objects resurrect...
Pablo Galindo [Sun, 13 Oct 2019 15:48:59 +0000 (16:48 +0100)]
bpo-38379: Don't block collection of unreachable objects when some objects resurrect (GH-16687)

Currently if any finalizer invoked during garbage collection resurrects any object, the gc gives up and aborts the collection. Although finalizers are assured to only run once per object, this behaviour of the gc can lead to an ever-increasing memory situation if new resurrecting objects are allocated in every new gc collection.

To avoid this, recompute what objects among the unreachable set need to be resurrected and what objects can be safely collected. In this way, resurrecting objects will not block the collection of other objects in the unreachable set.

4 years agoCorrect signature of __build_class__ (GH-16735)
Pablo Galindo [Sun, 13 Oct 2019 15:35:41 +0000 (16:35 +0100)]
Correct signature of __build_class__ (GH-16735)

4 years agobpo-38202: Fix a crash in dict_view & non-itearble. (GH-16241)
Zackery Spytz [Sun, 13 Oct 2019 11:49:05 +0000 (05:49 -0600)]
bpo-38202: Fix a crash in dict_view & non-itearble. (GH-16241)

4 years agobpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)
Samuel Colvin [Sun, 13 Oct 2019 11:45:36 +0000 (12:45 +0100)]
bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)

4 years agobpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
Serhiy Storchaka [Sun, 13 Oct 2019 08:59:31 +0000 (11:59 +0300)]
bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)

They conflicted with keyword "in".

Also rename positional-only parameters of private os._fcopyfile()
for consistency.

4 years agobpo-38456: Handle the case when there is no 'true' command (GH-16739)
Pablo Galindo [Sun, 13 Oct 2019 01:40:24 +0000 (02:40 +0100)]
bpo-38456: Handle the case when there is no 'true' command (GH-16739)

4 years agobpo-38282: Correctly manage the Bluetooth L2CAP socket structure in FreeBSD (GH-16738)
Pablo Galindo [Sun, 13 Oct 2019 01:03:54 +0000 (02:03 +0100)]
bpo-38282: Correctly manage the Bluetooth L2CAP socket structure in FreeBSD (GH-16738)

4 years agobpo-38456: Use /bin/true in test_subprocess (GH-16736)
Gregory P. Smith [Sat, 12 Oct 2019 23:35:53 +0000 (16:35 -0700)]
bpo-38456: Use /bin/true in test_subprocess (GH-16736)

* bpo-38456: Use /bin/true in test_subprocess.

Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)"
use /bin/true when it is available.  On a reasonable machine this
shaves up to two seconds wall time off the otherwise ~40sec execution
on a --with-pydebug build.  It should be more notable on many
buildbots or overloaded slower I/O systems (CI, etc).

4 years agobpo-38417: Add umask support to subprocess (GH-16726)
Gregory P. Smith [Sat, 12 Oct 2019 20:24:56 +0000 (13:24 -0700)]
bpo-38417: Add umask support to subprocess (GH-16726)

On POSIX systems, allow the umask to be set in the child process before we exec.

4 years agobpo-37731: Reorder includes in xmltok.c to avoid redefinition of _POSIX_C_SOURCE...
Pablo Galindo [Sat, 12 Oct 2019 19:14:11 +0000 (20:14 +0100)]
bpo-37731: Reorder includes in xmltok.c to avoid redefinition of _POSIX_C_SOURCE (GH-16733)

4 years agoFix minor typos in Whatsnew
Hugo van Kemenade [Sat, 12 Oct 2019 17:53:36 +0000 (20:53 +0300)]
Fix minor typos in Whatsnew

4 years agoAnnounce the change in the CancelledError inheritance (GH-16730)
Phil Jones [Sat, 12 Oct 2019 17:46:13 +0000 (17:46 +0000)]
Announce the change in the CancelledError inheritance (GH-16730)

This is a fairly noticeable change that requires adjustments in
existing asyncio code. It should therefore be announced.

4 years agobpo-35800: Deprecate smtpd.MailmanProxy (GH-11675)
Samuel Colvin [Sat, 12 Oct 2019 17:24:26 +0000 (18:24 +0100)]
bpo-35800: Deprecate smtpd.MailmanProxy (GH-11675)

Since `smtpd.MailmanProxy` is already broken, it is not formally deprecated in 3.9. It will be removed in 3.10.

https://bugs.python.org/issue35800

4 years agobpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of...
Abhilash Raj [Sat, 12 Oct 2019 05:41:35 +0000 (22:41 -0700)]
bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of URLs (GH-15522)" (GH-16724)

This reverts commit 87bd2071c756188b6cd577889fb1682831142ceb.

https://bugs.python.org/issue38449

4 years agobpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
Ruediger Pluem [Fri, 11 Oct 2019 13:36:50 +0000 (15:36 +0200)]
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)

 pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.

4 years agobpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715)
Serhiy Storchaka [Fri, 11 Oct 2019 08:44:42 +0000 (11:44 +0300)]
bpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715)

4 years agoFix strict-aliasing rules errors on gcc 4.8.5. (GH-16714)
Dong-hee Na [Fri, 11 Oct 2019 08:43:11 +0000 (17:43 +0900)]
Fix strict-aliasing rules errors on gcc 4.8.5. (GH-16714)

4 years agoTypo fix: "throuhgh" should be "through". (GH-16704)
Hansraj Das [Fri, 11 Oct 2019 03:43:13 +0000 (09:13 +0530)]
Typo fix: "throuhgh" should be "through". (GH-16704)

4 years agodocs: Add asyncio source code links (GH-16640)
Kyle Stanley [Thu, 10 Oct 2019 23:18:46 +0000 (19:18 -0400)]
docs: Add asyncio source code links (GH-16640)

4 years agobpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)
Pablo Galindo [Thu, 10 Oct 2019 21:45:17 +0000 (22:45 +0100)]
bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)

4 years agoRemove AppVeyor badge now that we don't use it in the CI anymore (GH-16708)
Pablo Galindo [Thu, 10 Oct 2019 21:39:15 +0000 (22:39 +0100)]
Remove AppVeyor badge now that we don't use it in the CI anymore (GH-16708)

4 years agobpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)
Victor Stinner [Thu, 10 Oct 2019 19:30:20 +0000 (21:30 +0200)]
bpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)

Rewrite getsockaddrarg() helper function of socketmodule.c (_socket
module) to prevent a false alarm when compiling codde using GCC with
_FORTIFY_SOURCE=2. Pass a pointer of the sock_addr_t union, rather
than passing a pointer to a sockaddr structure.

Add "struct sockaddr_tipc tipc;" to the sock_addr_t union.

4 years agoRe-enable the OverflowError test for test_truediv on test_complex (GH-16591)
Dong-hee Na [Thu, 10 Oct 2019 16:23:36 +0000 (01:23 +0900)]
Re-enable the OverflowError test for test_truediv on test_complex (GH-16591)

4 years agobpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)
Victor Stinner [Thu, 10 Oct 2019 13:42:30 +0000 (15:42 +0200)]
bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)

bpo-38353, bpo-38429: Fix typos introduced by commit
c02b41b1fb115c87693530ea6a480b2e15460424 in
calculate_argv0_path_framework() of getpath.c.

4 years agobpo-32996: Documentation fix-up. (GH-16646)
M. Eric Irrgang [Thu, 10 Oct 2019 11:11:33 +0000 (14:11 +0300)]
bpo-32996: Documentation fix-up. (GH-16646)

PR #4906 changed the typing.Generic class hierarchy, leaving an
outdated comment in the library reference. User-defined Generic ABCs now
must get a abc.ABCMeta metaclass from something other than typing.Generic
inheritance.

4 years agobpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
Dong-hee Na [Thu, 10 Oct 2019 07:41:26 +0000 (16:41 +0900)]
bpo-38425: Fix â€˜res’ may be used uninitialized warning (GH-16688)

4 years agobpo-38109: Add missing constants to Lib/stat.py (GH-16665)
Ronan Lamy [Thu, 10 Oct 2019 07:34:46 +0000 (09:34 +0200)]
bpo-38109: Add missing constants to Lib/stat.py (GH-16665)

Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT,
stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to
the Python implementation of the stat module.

4 years agobpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
Victor Stinner [Thu, 10 Oct 2019 07:32:13 +0000 (09:32 +0200)]
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)

bpo-38392, bpo-38426: Fix a compiler warning in gcmodule.c.

Fix also a typo in PYMEM_DEADBYTE macro comment.

4 years agobpo-38409: Fix grammar in str.strip() docstring (GH-16682)
Zachary Ware [Wed, 9 Oct 2019 21:09:00 +0000 (16:09 -0500)]
bpo-38409: Fix grammar in str.strip() docstring (GH-16682)

4 years agobpo-38379: don't claim objects are collected when they aren't (#16658)
Tim Peters [Wed, 9 Oct 2019 17:37:30 +0000 (12:37 -0500)]
bpo-38379:  don't claim objects are collected when they aren't (#16658)

* bpo-38379:  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.

4 years agoTypo fix: "empy" should be "empty". (GH-16666)
Hansraj Das [Wed, 9 Oct 2019 02:24:02 +0000 (07:54 +0530)]
Typo fix: "empy" should be "empty". (GH-16666)

4 years agocloses bpo-36161: Use thread-safe ttyname_r instead of ttyname. (GH-14868)
Antonio Gutierrez [Wed, 9 Oct 2019 02:19:48 +0000 (04:19 +0200)]
closes bpo-36161: Use thread-safe ttyname_r instead of ttyname. (GH-14868)

Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
4 years agobpo-38368: Added fix for ctypes crash when handling arrays in structs… (GH-16589)
Vinay Sajip [Tue, 8 Oct 2019 20:59:06 +0000 (21:59 +0100)]
bpo-38368: Added fix for ctypes crash when handling arrays in structs… (GH-16589)

4 years agobpo-37531: regrtest ignores output on timeout (GH-16659)
Victor Stinner [Tue, 8 Oct 2019 16:45:43 +0000 (18:45 +0200)]
bpo-37531: regrtest ignores output on timeout (GH-16659)

bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call
`popen.communicate() again: it can hang until all child processes
using stdout and stderr pipes completes. Kill the worker process and
ignores its output.

Reenable test_regrtest.test_multiprocessing_timeout().

bpo-37531: Change also the faulthandler timeout of the main process
from 1 minute to 5 minutes, for Python slowest buildbots.

4 years agotest_dictviews: Add testcase for dictviews_sub (GH-16660)
Dong-hee Na [Tue, 8 Oct 2019 15:59:10 +0000 (00:59 +0900)]
test_dictviews: Add testcase for dictviews_sub (GH-16660)

4 years agobpo-38395: Fix ownership in weakref.proxy methods (GH-16632)
Pablo Galindo [Tue, 8 Oct 2019 15:30:50 +0000 (16:30 +0100)]
bpo-38395: Fix ownership in weakref.proxy methods (GH-16632)

The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods.

4 years agobpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
Victor Stinner [Tue, 8 Oct 2019 13:42:17 +0000 (15:42 +0200)]
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)

Valgrind emits "Conditional jump or move depends on uninitialised
value(s)" false alarms on GCC builtin strcmp() function. The GCC code
is correct.

Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936

4 years agobpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
Serhiy Storchaka [Tue, 8 Oct 2019 13:30:17 +0000 (16:30 +0300)]
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)

4 years agobpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
Serhiy Storchaka [Tue, 8 Oct 2019 13:29:52 +0000 (16:29 +0300)]
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)

4 years agobpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH...
Serhiy Storchaka [Tue, 8 Oct 2019 11:32:25 +0000 (14:32 +0300)]
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583)

It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.

4 years agobpo-38371: Tkinter: deprecate the split() method. (GH-16584)
Serhiy Storchaka [Tue, 8 Oct 2019 11:31:35 +0000 (14:31 +0300)]
bpo-38371: Tkinter: deprecate the split() method. (GH-16584)

4 years agobpo-33714: Output an exception raised in module's m_clear(). (GH-16592)
Serhiy Storchaka [Tue, 8 Oct 2019 10:46:17 +0000 (13:46 +0300)]
bpo-33714: Output an exception raised in module's m_clear(). (GH-16592)

It is similar to the more general code in the gc module, but
here we know the name of the module.

https://bugs.python.org/issue33714

Automerge-Triggered-By: @encukou
4 years agoFix typo in _warnings.warn_explicit() docstring (GH-16625)
Hansraj Das [Tue, 8 Oct 2019 08:56:07 +0000 (14:26 +0530)]
Fix typo in _warnings.warn_explicit() docstring (GH-16625)

4 years agocloses bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599)
Antonio Gutierrez [Tue, 8 Oct 2019 04:22:17 +0000 (06:22 +0200)]
closes bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599)

Checks also for encryption algorithms methods not supported in different
OSs.

Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
4 years agobpo-38070: Enhance visit_decref() debug trace (GH-16631)
Victor Stinner [Tue, 8 Oct 2019 00:37:38 +0000 (02:37 +0200)]
bpo-38070: Enhance visit_decref() debug trace (GH-16631)

subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.

4 years agobpo-38400 Don't check for NULL linked list pointers in _PyObject_IsFreed (GH-16630)
Pablo Galindo [Mon, 7 Oct 2019 23:43:14 +0000 (00:43 +0100)]
bpo-38400 Don't check for NULL linked list pointers in _PyObject_IsFreed (GH-16630)

Some objects like Py_None are not initialized with conventional means
that prepare the circular linked list pointers, leaving them unlinked
from the rest of the objects. For those objects, NULL pointers does
not mean that they are freed, so we need to skip the check in those
cases.

4 years agobpo-38392: PyObject_GC_Track() validates object in debug mode (GH-16615)
Victor Stinner [Mon, 7 Oct 2019 22:09:31 +0000 (00:09 +0200)]
bpo-38392: PyObject_GC_Track() validates object in debug mode (GH-16615)

In debug mode, PyObject_GC_Track() now calls tp_traverse() of the
object type to ensure that the object is valid: test that objects
visited by tp_traverse() are valid.

Fix pyexpat.c: only track the parser in the GC once the parser is
fully initialized.

4 years agobpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)
Victor Stinner [Mon, 7 Oct 2019 21:44:05 +0000 (23:44 +0200)]
bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)

Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.

4 years agobpo-38344: Fix syntax in activate.bat (GH-16533)
James Abel [Mon, 7 Oct 2019 21:07:19 +0000 (14:07 -0700)]
bpo-38344: Fix syntax in activate.bat (GH-16533)

4 years agobpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)
Ricardo Bánffy [Mon, 7 Oct 2019 20:54:35 +0000 (21:54 +0100)]
bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.

4 years agobpo-36389: Fix _PyBytesWriter in release mode (GH-16624)
Victor Stinner [Mon, 7 Oct 2019 20:31:42 +0000 (22:31 +0200)]
bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)

Fix _PyBytesWriter API when Python is built in release mode with
assertions.

4 years agobpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)
Victor Stinner [Mon, 7 Oct 2019 16:42:01 +0000 (18:42 +0200)]
bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)

bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.

Modify the following functions to also work in release mode:

* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()

Other changes:

* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
  (equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
  with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
  attempt to render repr() at the end.

4 years agobpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
Ben Harper [Mon, 7 Oct 2019 16:19:58 +0000 (12:19 -0400)]
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)

4 years agoFix a compile warning in selectmodule.c. (GH-16617)
Xiang Zhang [Mon, 7 Oct 2019 12:01:54 +0000 (20:01 +0800)]
Fix a compile warning in selectmodule.c. (GH-16617)

4 years agobpo-38391: Fixing a typo for Py_DECREF (GH-16616)
Krishna Oza [Mon, 7 Oct 2019 11:57:45 +0000 (17:27 +0530)]
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)

4 years agobpo-38353: Simplify calculate_pybuilddir() (GH-16614)
Victor Stinner [Mon, 7 Oct 2019 10:56:59 +0000 (12:56 +0200)]
bpo-38353: Simplify calculate_pybuilddir() (GH-16614)

Calling _Py_wfopen() is enough to check if filename is an existing
file or not. There is no need to check first isfile().

4 years agobpo-38210: Fix compiler warning in dictobject.c (GH-16611)
Victor Stinner [Mon, 7 Oct 2019 10:28:16 +0000 (12:28 +0200)]
bpo-38210: Fix compiler warning in dictobject.c (GH-16611)

The "tmp" variable is no longer used.

4 years agoFix a compile warning in dictobject.c (GH-16610)
Hai Shi [Mon, 7 Oct 2019 10:20:05 +0000 (18:20 +0800)]
Fix a compile warning in dictobject.c (GH-16610)

4 years agobpo-25988: Do not expose abstract collection classes in the collections module. ...
Serhiy Storchaka [Mon, 7 Oct 2019 09:10:15 +0000 (12:10 +0300)]
bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596)

4 years ago bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
Adam J. Stewart [Mon, 7 Oct 2019 02:08:48 +0000 (21:08 -0500)]
 bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)

The `required` argument to `argparse.add_subparsers` was added in #3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
4 years agobpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray....
Hai Shi [Sun, 6 Oct 2019 12:17:18 +0000 (20:17 +0800)]
bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603)

4 years agobpo-38210: Fix intersection operation with dict view and iterator. (GH-16602)
Dong-hee Na [Sun, 6 Oct 2019 11:28:33 +0000 (20:28 +0900)]
bpo-38210: Fix intersection operation with dict view and iterator. (GH-16602)

4 years agobpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)
Andrei Troie [Sat, 5 Oct 2019 16:19:15 +0000 (17:19 +0100)]
bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)

KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.

4 years agobpo-38341: Add SMTPNotSupportedError in the exports of smtplib (#16525)
nde [Sat, 5 Oct 2019 00:30:58 +0000 (02:30 +0200)]
bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (#16525)

Add SMTPNotSupportedError in the exports of smtplib

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
4 years agobpo-38353: getpath.c: allocates strings on the heap (GH-16585)
Victor Stinner [Fri, 4 Oct 2019 17:53:43 +0000 (19:53 +0200)]
bpo-38353: getpath.c: allocates strings on the heap (GH-16585)

* _Py_FindEnvConfigValue() now returns a string allocated
  by PyMem_RawMalloc().
* calculate_init() now decodes VPATH macro.
* Add calculate_open_pyenv() function.
* Add substring() and joinpath2() functions.

* Fix add_exe_suffix()

And a few cleanup changes.

4 years agobpo-38353: getpath.c uses dynamically allocated strings (GH-16582)
Victor Stinner [Fri, 4 Oct 2019 13:25:50 +0000 (15:25 +0200)]
bpo-38353: getpath.c uses dynamically allocated strings (GH-16582)

* PyCalculatePath: add "_macro" to the 3 fields storing macro values
* Add dynamically allocated strings to PyCalculatePath

4 years agobpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal (GH-16558)
Joannah Nanjekye [Fri, 4 Oct 2019 11:35:42 +0000 (08:35 -0300)]
bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal (GH-16558)

Revert the removal of PyThreadState_DeleteCurrent() with documentation.

4 years agobpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)
Serhiy Storchaka [Fri, 4 Oct 2019 10:09:52 +0000 (13:09 +0300)]
bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)

On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).

4 years agoUpdated CODEOWNERS to indicate ownership of some modules. (GH-16578)
Vinay Sajip [Fri, 4 Oct 2019 08:48:24 +0000 (09:48 +0100)]
Updated CODEOWNERS to indicate ownership of some modules. (GH-16578)

4 years agobpo-38235: Correct some arguments names in logging documentation (GH-16571)
Ashley Whetter [Fri, 4 Oct 2019 07:55:14 +0000 (00:55 -0700)]
bpo-38235: Correct some arguments names in logging documentation (GH-16571)

4 years agobpo-38353: Rework ismodule() in getpath.c (GH-16574)
Victor Stinner [Fri, 4 Oct 2019 01:53:26 +0000 (03:53 +0200)]
bpo-38353: Rework ismodule() in getpath.c (GH-16574)

* ismodule() no longer modify the input string.
* copy_absolute(), joinpath(): rename parameters and local variables.

4 years agobpo-38353: Add subfunctions to getpath.c (GH-16572)
Victor Stinner [Fri, 4 Oct 2019 00:22:39 +0000 (02:22 +0200)]
bpo-38353: Add subfunctions to getpath.c (GH-16572)

Following symbolic links is now limited to 40 attempts, just to
prevent loops.

Add subfunctions:

* Add resolve_symlinks()
* Add calculate_argv0_path_framework()
* Add calculate_which()
* Add calculate_program_macos()

Fix also _Py_wreadlink(): readlink() result type is Py_ssize_t, not
int.

4 years agobpo-38353: Fix compiler warning in internal headers (GH-16573)
Victor Stinner [Fri, 4 Oct 2019 00:21:05 +0000 (02:21 +0200)]
bpo-38353: Fix compiler warning in internal headers (GH-16573)

Replace "_PyRuntimeState" with "struct pyruntimestate" to avoid
a warning on typedef re-definition.

4 years agobpo-38353: Fix compiler warning in pycore_initconfig.h (GH-16570)
Victor Stinner [Thu, 3 Oct 2019 22:43:10 +0000 (00:43 +0200)]
bpo-38353: Fix compiler warning in pycore_initconfig.h (GH-16570)

Replace "_PyRuntimeState" with "struct pyruntimestate" to avoid
a warning on typedef re-definition.

4 years agobpo-38353: Fix calculate_argv0_path() for symlinks (GH-16549)
Victor Stinner [Thu, 3 Oct 2019 21:17:00 +0000 (23:17 +0200)]
bpo-38353: Fix calculate_argv0_path() for symlinks (GH-16549)

calculate_argv0_path() must read argv0_path link, not read
program_full_path link.

4 years agobpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)
idomic [Thu, 3 Oct 2019 21:08:29 +0000 (00:08 +0300)]
bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)

4 years agobpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)
Steve Dower [Thu, 3 Oct 2019 15:31:21 +0000 (08:31 -0700)]
bpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)

4 years agobpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)
Steve Dower [Thu, 3 Oct 2019 15:31:03 +0000 (08:31 -0700)]
bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)