]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 years agobpo-24746: Fix doctest failures when running the testsuite with -R (#11501) (#11512)
Senthil Kumaran [Thu, 10 Jan 2019 20:55:08 +0000 (12:55 -0800)] 
bpo-24746: Fix doctest failures when running the testsuite with -R (#11501) (#11512)

7 years agoUpdate bugs.rst (GH-11487)
Miss Islington (bot) [Wed, 9 Jan 2019 23:00:48 +0000 (15:00 -0800)] 
Update bugs.rst (GH-11487)

(cherry picked from commit 91c6158dbc5d70fcd91993b4e62c7bae926c2ea2)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
7 years ago[2.7] bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#11482)
Sanyam Khurana [Wed, 9 Jan 2019 19:03:03 +0000 (00:33 +0530)] 
[2.7] bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#11482)

* bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff

* [2.7] bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (GH-10639).
(cherry picked from commit cbb16459934eaf29c7c7d362939cd05550b2f21f)

Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
7 years agoRemove README.rst inadvertandly "backported" from 3.x in 5a89c71580529549e71567abf557...
Benjamin Peterson [Wed, 2 Jan 2019 17:14:30 +0000 (09:14 -0800)] 
Remove README.rst inadvertandly "backported" from 3.x in 5a89c71580529549e71567abf557c812eb470b2b. (GH-11409)

7 years ago[2.7] Bump copyright years to 2019. (GH-11408)
Benjamin Peterson [Wed, 2 Jan 2019 16:43:32 +0000 (08:43 -0800)] 
[2.7] Bump copyright years to 2019. (GH-11408)

(cherry picked from commit 9a69ae8a78785105ded02b083b2e5cd2dd939307)

7 years agomacOS installer build: mitigate hdiutil resource busy bug
Ned Deily [Tue, 11 Dec 2018 03:05:14 +0000 (22:05 -0500)] 
macOS installer build: mitigate hdiutil resource busy bug

7 years agoRevert "bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)"
Ned Deily [Thu, 27 Dec 2018 20:18:51 +0000 (15:18 -0500)] 
Revert "bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)"

This reverts commit aa580508431d231677cfaa13ac9b6aa37538b9ef.

Due to regressions found with using Tk 8.6.9.1, build the python.org
macOS installers with Tcl/Tk 8.6.8 as used in previous releases.

7 years agobpo-11566: Remove hypot -> _hypot macro for very old compilers (GH-11283)
Matt McCormick [Sat, 22 Dec 2018 01:41:36 +0000 (20:41 -0500)] 
bpo-11566: Remove hypot -> _hypot macro for very old compilers (GH-11283)

This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2] https://mingwpy.github.io/

7 years ago[2.7] bpo-31715 Add mimetype for extension .mjs (GH-3908) (GH-10978)
Myles Borins [Thu, 20 Dec 2018 20:29:34 +0000 (15:29 -0500)] 
[2.7] bpo-31715 Add mimetype for extension .mjs (GH-3908) (GH-10978)

(cherry picked from 0854b92cd2)

7 years agobpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175...
Zackery Spytz [Thu, 20 Dec 2018 17:38:52 +0000 (10:38 -0700)] 
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175) (GH-11249)

(cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)

7 years agobpo-35529: Fix a reference counting bug in PyCFuncPtr_FromDll(). (GH-11229)
Miss Islington (bot) [Thu, 20 Dec 2018 08:51:52 +0000 (00:51 -0800)] 
bpo-35529: Fix a reference counting bug in PyCFuncPtr_FromDll(). (GH-11229)

"dll" would leak if an error occurred in _validate_paramflags() or
GenericPyCData_new().
(cherry picked from commit d77d97c9a1f593fe161afab97e2a3e2292ab88b9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years ago[2.7] bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033...
Serhiy Storchaka [Wed, 19 Dec 2018 15:11:02 +0000 (17:11 +0200)] 
[2.7] bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033) (GH-11234)

In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.

In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.

In addition, check if the list changed size in the loop in array_array_fromlist().
(cherry picked from commit 99d56b53560b3867844472ae381fb3f858760621)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-10320: Use PY_FORMAT_LONG_LONG in ctypes' PyCArg_repr(). (GH-11230)
Zackery Spytz [Wed, 19 Dec 2018 06:01:38 +0000 (23:01 -0700)] 
bpo-10320: Use PY_FORMAT_LONG_LONG in ctypes' PyCArg_repr(). (GH-11230)

7 years agobpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(...
Miss Islington (bot) [Tue, 18 Dec 2018 23:51:04 +0000 (15:51 -0800)] 
bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(). (GH-10853)

Use "ll" instead of the nonstandard "q".
(cherry picked from commit 062cbb67726f26794b1b461853e40696b4a0b220)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-10496: distutils check_environ() handles getpwuid() error (GH-10931) (GH-11213)
Victor Stinner [Tue, 18 Dec 2018 16:34:51 +0000 (17:34 +0100)] 
bpo-10496: distutils check_environ() handles getpwuid() error (GH-10931) (GH-11213)

check_environ() of distutils.utils now catchs KeyError on calling
pwd.getpwuid(): don't create the HOME environment variable in this
case.

(cherry picked from commit 17d0c0595e101c4ce76b58e55de37e6b5083e6cd)

7 years agobpo-34279: regrtest consider that skipped tests are ran (GH-11132) (GH-11158)
Victor Stinner [Fri, 14 Dec 2018 12:44:08 +0000 (13:44 +0100)] 
bpo-34279: regrtest consider that skipped tests are ran (GH-11132) (GH-11158)

bpo-34279, bpo-35412: support.run_unittest() no longer raises
TestDidNotRun if a test result contains skipped tests. The
exception is now only raised if no test have been run and no test
have been skipped.

(cherry picked from commit 3a8f4fef4a4dd0e4a800545468eef9542e126181)

7 years agobpo-16039: CVE-2013-1752: Limit imaplib.IMAP4_SSL.readline() (GH-11120)
Victor Stinner [Wed, 12 Dec 2018 11:05:59 +0000 (12:05 +0100)] 
bpo-16039: CVE-2013-1752: Limit imaplib.IMAP4_SSL.readline() (GH-11120)

* bpo-16039: CVE-2013-1752: Change use of readline() in
  imaplib.IMAP4_SSL to limit line length. Remove IMAP4_SSL.readline()
  and IMAP4_SSL.read() to inherit safe IMAP4 implementation.
* bpo-20118: reenable test_linetoolong() of test_imaplib
  on ThreadedNetworkedTests and ThreadedNetworkedTestsSSL.
  The test now sets the _MAXLINE limit to 10 characters.

7 years agobpo-11617: Try to strengthen test_httpservers (GH-11121)
Victor Stinner [Tue, 11 Dec 2018 16:08:02 +0000 (17:08 +0100)] 
bpo-11617: Try to strengthen test_httpservers (GH-11121)

(cherry picked from commit cb342182ee47c3e2c743de50d81aad60f4eebefd)

7 years ago[2.7] bpo-15663: the 10.6+ macOS installers for 3.6/2.7 now provide a private Tcl...
Ned Deily [Tue, 11 Dec 2018 09:33:56 +0000 (04:33 -0500)] 
[2.7] bpo-15663: the 10.6+ macOS installers for 3.6/2.7 now provide a private Tcl/Tk 8.6 (GH-11110)

7 years agobpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)
Miss Islington (bot) [Tue, 11 Dec 2018 06:39:34 +0000 (22:39 -0800)] 
bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)

(cherry picked from commit 7cf3d8e25174c8871883e42f3240fd7f01efd3a8)

Co-authored-by: Ned Deily <nad@python.org>
7 years ago[3.6] bpo-35401: Update macOS installer to OpenSSL 1.0.2q (GH-11095)
Miss Islington (bot) [Tue, 11 Dec 2018 05:54:04 +0000 (21:54 -0800)] 
[3.6] bpo-35401: Update macOS installer to OpenSSL 1.0.2q (GH-11095)

https://bugs.python.org/issue35401
(cherry picked from commit 419b5ffc2ca46d7adf0be6216ca3a6e40028e50f)

Co-authored-by: Ned Deily <nad@python.org>
7 years agobpo-35401: Updates Windows build to OpenSSL 1.0.2q (GH-11089)
Steve Dower [Tue, 11 Dec 2018 04:26:33 +0000 (20:26 -0800)] 
bpo-35401: Updates Windows build to OpenSSL 1.0.2q (GH-11089)

7 years ago[2.7] bpo-31374: Include pyconfig.h earlier in expat (GH-11078)
Victor Stinner [Mon, 10 Dec 2018 15:01:03 +0000 (16:01 +0100)] 
[2.7] bpo-31374: Include pyconfig.h earlier in expat (GH-11078)

Include <pyconfig.h> ealier in Modules/expat/xmlparse.c to define
properly _POSIX_C_SOURCE and _XOPEN_SOURCE.

7 years agoceval.c: mark debug 'filename' variable as unused (GH-11074)
Victor Stinner [Mon, 10 Dec 2018 12:53:38 +0000 (13:53 +0100)] 
ceval.c: mark debug 'filename' variable as unused (GH-11074)

Use GCC __attribute__((unused)) to mark the debug variable 'filename'
as unused in Python/ceval.c.

7 years agobpo-31374: Include pyconfig.h earlier in expat (GH-11064)
Miss Islington (bot) [Mon, 10 Dec 2018 11:38:55 +0000 (03:38 -0800)] 
bpo-31374: Include pyconfig.h earlier in expat (GH-11064)

Include <pyconfig.h> ealier in Modules/expat/xmltok.c to define
properly _POSIX_C_SOURCE. Python defines _POSIX_C_SOURCE as 200809L,
whereas <features.h> (included indirectly by <string.h>) defines
_POSIX_C_SOURCE as 199506L.
(cherry picked from commit cf247359d5b7082044eea1fa94b5211a172b1ff6)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
7 years agobpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061) (GH-11068)
Victor Stinner [Mon, 10 Dec 2018 10:56:54 +0000 (11:56 +0100)] 
bpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061) (GH-11068)

Fix xml.dom.minidom cloneNode() on a document with an entity: pass
the correct arguments to the user data handler of an entity (fix an
old copy/paste mistake).

Bug spotted and fix proposed by Charalampos Stratakis, initial
reproducer written by Petr Viktorin.

Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com>
Co-Authored-By: Petr Viktorin <encukou@gmail.com>
(cherry picked from commit 8e0418688906206fe59bd26344320c0fc026849e)

7 years ago[2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001...
Serhiy Storchaka [Fri, 7 Dec 2018 06:02:33 +0000 (08:02 +0200)] 
[2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) (GH-11008)

(cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2)
(cherry picked from commit 7a2cf1e7d3bf300e98c702589d405734f4a8fcf8)

7 years agoAdd missing period in distutils.dep_util.newer_group doc (GH-11003)
Miss Islington (bot) [Thu, 6 Dec 2018 21:34:15 +0000 (13:34 -0800)] 
Add missing period in distutils.dep_util.newer_group doc (GH-11003)

(cherry picked from commit c9566b8c454120e3d0ddb5ab970f262a6cd80077)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
7 years agobpo-35359: Add _CRT_SECURE_NO_WARNINGS to pythoncore project (GH-10819)
Victor Stinner [Thu, 6 Dec 2018 10:56:00 +0000 (11:56 +0100)] 
bpo-35359: Add _CRT_SECURE_NO_WARNINGS to pythoncore project (GH-10819)

Define _CRT_SECURE_NO_WARNINGS in the Visual Studio pythoncore
project to make quiet security warnings when building zlib C files
(Modules\zlib\ subdirectory).

7 years ago[2.7] bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. ...
native-api [Thu, 6 Dec 2018 09:43:37 +0000 (12:43 +0300)] 
[2.7] bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278) (GH-7279)

7 years ago[2.7] Correct a couple of unbalanced parenthesis. (GH-10779). (GH-10963)
Andre Delfino [Thu, 6 Dec 2018 09:19:23 +0000 (06:19 -0300)] 
[2.7] Correct a couple of unbalanced parenthesis. (GH-10779). (GH-10963)

(cherry picked from commit 55f41e45b4318cbe19209f5144641344d0049fb8)

7 years agoRevert "[2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted...
Victor Stinner [Thu, 6 Dec 2018 00:49:41 +0000 (01:49 +0100)] 
Revert "[2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686)" (GH-10970)

This reverts commit 4a7dd30f5810e8861a3834159a222ab32d5c97d0.

7 years agoFix typo in xml.dom.minidom documentation (GH-10956)
Miss Islington (bot) [Wed, 5 Dec 2018 22:31:11 +0000 (14:31 -0800)] 
Fix typo in xml.dom.minidom documentation (GH-10956)

Escape the \t and \n.
Follow up from https://github.com/python/cpython/pull/10814.
(cherry picked from commit 2d8f976cde4794d174b44ff7d5fd970aa89c65e8)

Co-authored-by: E Kawashima <e-kwsm@users.noreply.github.com>
7 years ago[2.7] bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. ...
Serhiy Storchaka [Wed, 5 Dec 2018 22:21:40 +0000 (00:21 +0200)] 
[2.7] bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946) (GH-10955)

(cherry picked from commit 5b25f1d03100e2283c1b129d461ba68ac0169a14)
(cherry picked from commit 1de91a0032fed500ddd3d8c4fb7a38c0b8719f67)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>.
7 years ago[2.7] bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419...
Serhiy Storchaka [Wed, 5 Dec 2018 22:02:10 +0000 (00:02 +0200)] 
[2.7] bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419). (GH-10950)

(cherry picked from commit 67a93b3a0b3814e97ef9d077b21325fc8ce351b2)

7 years ago[2.7] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565)...
Serhiy Storchaka [Wed, 5 Dec 2018 21:10:36 +0000 (23:10 +0200)] 
[2.7] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565). (GH-10943)

(cherry picked from commit 4edeaeac4c194ba5d09187640b5cfca5e03be617)

Co-authored-by: Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) <thatiparthysreenivas@gmail.com>
7 years ago[2.7] Move __missing__ after __delitem__ in Data model. (GH-10923). (GH-10944)
Andre Delfino [Wed, 5 Dec 2018 21:09:25 +0000 (18:09 -0300)] 
[2.7] Move __missing__ after __delitem__ in Data model. (GH-10923). (GH-10944)

(cherry picked from commit 1ce853f37783575e2b3aaa159ddcebc8660830ef)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
7 years agobpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919) (GH-10930)
Victor Stinner [Wed, 5 Dec 2018 20:56:24 +0000 (21:56 +0100)] 
bpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919) (GH-10930)

* posixpath.expanduser() now returns the input path unchanged if
  the HOME environment variable is not set and pwd.getpwuid() raises
  KeyError (the current user identifier doesn't exist in the password
  database).
* Add test_no_home_directory() to test_site.

(cherry picked from commit f2f4555d8287ad217a1dba7bbd93103ad4daf3a8)

7 years agobpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)
Miss Islington (bot) [Wed, 5 Dec 2018 20:04:57 +0000 (12:04 -0800)] 
bpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)

When running test_bdb.py as a script, `import test_module` would be
importing the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.
(cherry picked from commit 54fd45505b3a365e6d53441e6dd7e0d1ec13b46f)

Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
7 years agobpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)
Miss Islington (bot) [Wed, 5 Dec 2018 01:22:02 +0000 (17:22 -0800)] 
bpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)

On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".

test.pythoninfo now also logs TRAVIS environment variable.
(cherry picked from commit c11b3b19a5b022c6c229043d37f9a9fd06f22500)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
7 years ago[2.7] bpo-16865: Support arrays >=2GB in ctypes. (GH-3006). (GH-7441)
Serhiy Storchaka [Tue, 4 Dec 2018 10:38:07 +0000 (12:38 +0200)] 
[2.7] bpo-16865: Support arrays >=2GB in ctypes. (GH-3006). (GH-7441)

(cherry picked from commit 735abadd5bd91db4a9e6f4311969b0afacca0a1a)

Co-Authored-By: Segev Finer <segev208@gmail.com>
7 years ago[2.7] bpo-25862: Fix several bugs in the _io module. (GH-8026) (GH-8033)
Serhiy Storchaka [Tue, 4 Dec 2018 10:02:48 +0000 (12:02 +0200)] 
[2.7] bpo-25862: Fix several bugs in the _io module. (GH-8026) (GH-8033)

They can be exposed when some C API calls fail due to lack of
memory.

* Failed Py_BuildValue() could cause an assertion error in the
  following TextIOWrapper.tell().
* initvalue could leak in StringIO.__getstate__() after failed
  PyDict_Copy().
(cherry picked from commit fdb5a50ef34f7951c3b01eb77b1359725a9ad670)

7 years agobpo-26544: Make platform.libc_ver() less slow (GH-10868)
Victor Stinner [Mon, 3 Dec 2018 15:49:24 +0000 (16:49 +0100)] 
bpo-26544: Make platform.libc_ver() less slow (GH-10868)

Coarse benchmark on Fedora 29: 1.6 sec => 0.1 sec.

Co-Authored-By: Antoine Pitrou <solipsis@pitrou.net>
(cherry-picked from commit ba7c226095703f63c78b00e56f1db8d99ac3a54a)

7 years agobpo-35368: Make PyMem_Malloc() thread-safe in debug mode (GH-10828)
Victor Stinner [Mon, 3 Dec 2018 11:29:29 +0000 (12:29 +0100)] 
bpo-35368: Make PyMem_Malloc() thread-safe in debug mode (GH-10828)

When Python is compiled in debug mode, PyMem_Malloc() uses debug
hooks, but it also uses pymalloc allocator instead of malloc().
Problem: pymalloc is not thread-safe, whereas PyMem_Malloc() is
thread-safe in release mode (it's a thin wrapper to malloc() in this
case).

Modify the debug hook to use malloc() for PyMem_Malloc().

7 years ago[2.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10827)
E Kawashima [Sat, 1 Dec 2018 12:16:00 +0000 (21:16 +0900)] 
[2.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10827)

(cherry picked from commit b7c2182604d5796b5af4c837991aa0b8c8a2d41f)

7 years agoReplace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833)
Victor Stinner [Fri, 30 Nov 2018 19:45:04 +0000 (20:45 +0100)] 
Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833)

Fix DeprecationWarning when tests are run using python -3.

7 years agobpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829)
Victor Stinner [Fri, 30 Nov 2018 17:08:02 +0000 (18:08 +0100)] 
bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829)

The pthread implementation of PyThread_start_new_thread() now uses
malloc/free rather than PyMem_Malloc/PyMem_Free, since the latters
are not thread-safe.

7 years agobpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823)
Victor Stinner [Fri, 30 Nov 2018 16:04:35 +0000 (17:04 +0100)] 
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823)

Fix an undefined behaviour in the pthread implementation of
PyThread_start_new_thread(): add a function wrapper to always return
NULL.

Add pythread_callback struct and pythread_wrapper() to thread_pthread.h.

(cherry picked from commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30)

7 years agobpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817)
Victor Stinner [Fri, 30 Nov 2018 12:02:41 +0000 (13:02 +0100)] 
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817)

testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a
race condition: time.sleep() is used as a weak synchronization
primitive and the tests fail randomly on slow buildbots.

Use a reliable threading.Event to fix these tests.

Other changes:

* Replace send() with sendall()
* Add a timeout to select() in testAccept() and testRecv()
* Use addCleanup() to close sockets
* Use assertRaises()

(cherry picked from commit ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265)

7 years agoFix DeprecationWarning in test_bytes (GH-10805)
Victor Stinner [Fri, 30 Nov 2018 10:04:42 +0000 (11:04 +0100)] 
Fix DeprecationWarning in test_bytes (GH-10805)

Running test_bytes with python -3 -Wd emits two DeprecationWarning on
"1/0". Use "1//0" to prevent the warning.

7 years agobpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
Miss Islington (bot) [Fri, 30 Nov 2018 08:04:43 +0000 (00:04 -0800)] 
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)

(cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804)
Victor Stinner [Thu, 29 Nov 2018 22:38:35 +0000 (23:38 +0100)] 
bpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804)

On Windows, test_env_changed() of test_regrtest is now skipped
because it fails  randomly for an unknown reason on "x86 Windows XP
VS9.0 2.7" buildbot worker.

7 years agobpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801)
Victor Stinner [Thu, 29 Nov 2018 20:14:42 +0000 (21:14 +0100)] 
bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801)

Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
7 years agocloses bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788)
Benjamin Peterson [Thu, 29 Nov 2018 07:37:15 +0000 (01:37 -0600)] 
closes bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788)

7 years agopythoninfo: log more environment variable (GH-10719) (GH-10774)
Victor Stinner [Wed, 28 Nov 2018 20:12:54 +0000 (21:12 +0100)] 
pythoninfo: log more environment variable (GH-10719) (GH-10774)

Log TZ to debug a timezone issue... and a few more :-)

(cherry picked from commit 282c03d45d2d766c55904a4eb766923a2c459124)

7 years agoLinkify SMTP.quit() in smtplib documentation. (GH-9785)
Miss Islington (bot) [Fri, 23 Nov 2018 17:01:31 +0000 (09:01 -0800)] 
Linkify SMTP.quit() in smtplib documentation. (GH-9785)

(cherry picked from commit ba57963a95a994947b8bec6869e810a74a751278)

Co-authored-by: takey <taketakeyyy@gmail.com>
7 years ago[2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) ...
Julien Palard [Thu, 22 Nov 2018 22:18:05 +0000 (23:18 +0100)] 
[2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) (GH-10667)

https://bugs.python.org/issue35035

7 years agobpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH...
Miss Islington (bot) [Wed, 21 Nov 2018 22:47:10 +0000 (14:47 -0800)] 
bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558)

(cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515)

Co-authored-by: Julien Palard <julien@palard.fr>
7 years ago[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617)
Serhiy Storchaka [Tue, 20 Nov 2018 19:56:34 +0000 (21:56 +0200)] 
[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617)

Fixes assertion failures in _datetimemodule.c
introduced in the previous fix (see bpo-31752).

Rather of trying to handle an int subclass as exact int,
let it to use overridden special methods, but check the
result of divmod().
(cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agoUpgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)
Miss Islington (bot) [Mon, 19 Nov 2018 13:07:58 +0000 (05:07 -0800)] 
Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)

(cherry picked from commit 8b9c33ea9ce902f902c9d9900121010801950547)

Co-authored-by: Donald Stufft <donald@stufft.io>
7 years agoAdd a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
Miss Islington (bot) [Fri, 16 Nov 2018 16:32:07 +0000 (08:32 -0800)] 
Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)

This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
(cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agoFix a possible reference leak in _socket.getaddrinfo(). (GH-10543)
Miss Islington (bot) [Thu, 15 Nov 2018 09:25:58 +0000 (01:25 -0800)] 
Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)

"single" needs to be decrefed if PyList_Append() fails.
(cherry picked from commit 4c596d54aa6a55e9d2a3db78891e656ebbfb63c8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years ago[2.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10538)
Gregory P. Smith [Wed, 14 Nov 2018 19:55:07 +0000 (11:55 -0800)] 
[2.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10538)

Discovered using clang's MemorySanitizer.

A msan build will fail by simply executing: ./python -c 'u"\N"'
(cherry picked from commit 746b2d3)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
7 years ago[2.7] Grammar corrections in abc.rst (GH-10525). (GH-10535)
Andrés Delfino [Wed, 14 Nov 2018 01:08:09 +0000 (22:08 -0300)] 
[2.7] Grammar corrections in abc.rst (GH-10525). (GH-10535)

(cherry picked from commit 8e0b05e2f4b9fd703cbe1ae8d058852ef3781f44)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agoLinkify PEP 8 in unix.rst (GH-10482)
Miss Islington (bot) [Mon, 12 Nov 2018 16:52:13 +0000 (08:52 -0800)] 
Linkify PEP 8 in unix.rst (GH-10482)

(cherry picked from commit 9404e7737bd09bc1df154e1216d721e5168e4c68)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years ago[2.7] bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252...
Andrés Delfino [Sun, 11 Nov 2018 20:09:03 +0000 (17:09 -0300)] 
[2.7] bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) (GH-10469)

https://bugs.python.org/issue33699
(cherry picked from commit b086c8afdb8c862011e3e27d4c8f6833749f2c56)

https://bugs.python.org/issue33699

7 years ago[2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433)
Alexey Izbyshev [Sat, 10 Nov 2018 05:47:12 +0000 (08:47 +0300)] 
[2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433)

This typo doesn't affect the result because wrong bits are discarded
on implicit conversion to unsigned char, but it trips UBSan
with -fsanitize=implicit-integer-truncation.
(cherry picked from commit 7a69cf47a9bbc95f95fd67c982bff121b2a903cb)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years ago[2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410)
Julien Palard [Thu, 8 Nov 2018 08:09:38 +0000 (09:09 +0100)] 
[2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410)

7 years agoAdd future_stmt to simple_stmt production list. (GH-8239)
Miss Islington (bot) [Thu, 8 Nov 2018 05:16:15 +0000 (21:16 -0800)] 
Add future_stmt to simple_stmt production list. (GH-8239)

(cherry picked from commit cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agoglob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)
Miss Islington (bot) [Wed, 7 Nov 2018 18:30:31 +0000 (10:30 -0800)] 
glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)

(cherry picked from commit ae31e3fbf4e7def772fc1c94342d1011424fdc99)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agoAdd a reference to the name mangling description in the tutorial to the index. (GH...
Miss Islington (bot) [Wed, 7 Nov 2018 18:30:12 +0000 (10:30 -0800)] 
Add a reference to the name mangling description in the tutorial to the index. (GH-10138)

(cherry picked from commit c5eec4426d9144b2255500217d0e3ff9463d2770)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agoCorrect grammar mistakes in string.rst. (GH-9752)
Miss Islington (bot) [Wed, 7 Nov 2018 17:55:07 +0000 (09:55 -0800)] 
Correct grammar mistakes in string.rst. (GH-9752)

(cherry picked from commit d64991031e4c86ce0331caac16770757511dd025)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agocloses bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH...
Miss Islington (bot) [Tue, 6 Nov 2018 04:59:07 +0000 (20:59 -0800)] 
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347)

The test depended on '/usr/share/zoneinfo/posixrules' or equivalent
because it set TZ without explicit DST transition rules. At least
on OpenSUSE Tumbleweed that file is linked to '/etc/localtime',
making the test fail with certain local timezones,
such as 'Europe/Moscow' which doesn't have DST transitions since 2011.
(cherry picked from commit f1b9ad3d38c11676b45edcbf2369239bae436e56)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years ago[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines...
Serhiy Storchaka [Mon, 5 Nov 2018 16:16:26 +0000 (18:16 +0200)] 
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336)

Two kind of mistakes:

1. Missed space. After concatenating there is no space between words.

2. Missed comma. Causes unintentional concatenating in a list of strings.
(cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d)
(cherry picked from commit 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d)

7 years ago[2.7] Docs: fix some wrong words (GH-6987) (GH-10315)
Stéphane Wirtel [Sun, 4 Nov 2018 19:38:50 +0000 (20:38 +0100)] 
[2.7] Docs: fix some wrong words (GH-6987) (GH-10315)

7 years agoFix a typo about a comma. (GH-10306)
Miss Islington (bot) [Sat, 3 Nov 2018 17:41:56 +0000 (10:41 -0700)] 
Fix a typo about a comma. (GH-10306)

(cherry picked from commit fe62d877e300e1ee4145fff8f2bdba498b685f91)

Co-authored-by: İsmail Arılık <arilik.ismail@gmail.com>
7 years ago[2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match...
Benjamin Peterson [Fri, 2 Nov 2018 03:28:34 +0000 (20:28 -0700)] 
[2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293)

This could cause compile errors on macOS or other platforms..
(cherry picked from commit 318ab63c01f5b8e7562b122ab5ba01258a51277b)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
7 years ago[2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203)
Lysandros Nikolaou [Thu, 1 Nov 2018 01:49:10 +0000 (02:49 +0100)] 
[2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203)

7 years agobpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH...
Miss Islington (bot) [Wed, 31 Oct 2018 12:37:06 +0000 (05:37 -0700)] 
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)

_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
7 years agobpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969)
matthewbelisle-wf [Tue, 30 Oct 2018 21:16:26 +0000 (16:16 -0500)] 
bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969)

Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by
limiting the number of `MiniFieldStorage` objects created by `FieldStorage`.

(cherry picked from commit 209144831b0a19715bda3bd72b14a3e6192d9cc1)

7 years ago[2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (GH-10218)
Zackery Spytz [Mon, 29 Oct 2018 16:03:26 +0000 (10:03 -0600)] 
[2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (GH-10218)

(cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07)

7 years agobpo-27741: Better wording for datetime.strptime() (GH-9994)
Miss Islington (bot) [Mon, 29 Oct 2018 11:55:15 +0000 (04:55 -0700)] 
bpo-27741: Better wording for datetime.strptime() (GH-9994)

(cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348)

Co-authored-by: Gus Goulart <augusto@goulart.me>
7 years ago[2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099)
Zackery Spytz [Mon, 29 Oct 2018 07:23:59 +0000 (01:23 -0600)] 
[2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099)

7 years ago[2.7] Fix checking for bugfix Tcl version. (GH-10185). (GH-10188)
Serhiy Storchaka [Sun, 28 Oct 2018 18:56:30 +0000 (20:56 +0200)] 
[2.7] Fix checking for bugfix Tcl version. (GH-10185). (GH-10188)

(cherry picked from commit 18d57b4d6262bf96b5ac307bd84837c29ea04083)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years ago[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)
Serhiy Storchaka [Sun, 28 Oct 2018 17:36:02 +0000 (19:36 +0200)] 
[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)

Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a25765d8a39a77220691698498e758d4)

7 years ago[2.7] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10157)
Mariatta [Sat, 27 Oct 2018 18:27:33 +0000 (11:27 -0700)] 
[2.7] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10157)

Referring to ``pytest`` as ``py.test`` is deprecated..
(cherry picked from commit d855f2fdbd73016ece9b58e6f6ac26cf986fabf6)

Co-authored-by: Andreas Pelme <andreas@pelme.se>
7 years agobpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Miss Islington (bot) [Sat, 27 Oct 2018 03:09:10 +0000 (20:09 -0700)] 
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)

Specify that blocks are non-overlapping. Change '!=' to '<'.
(cherry picked from commit d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129)
Denis Ledoux [Fri, 26 Oct 2018 15:15:22 +0000 (17:15 +0200)] 
bpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129)

Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.

(cherry picked from commit 10cb3760e8631a27f5db1e51b05494e29306c671)

7 years ago[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)
Miss Islington (bot) [Fri, 26 Oct 2018 13:29:42 +0000 (06:29 -0700)] 
[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)

(cherry picked from commit 1487b651caa62647f8f8c9e8432e475e3566130c)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years ago[2.7] bpo-34576 : Backport eeab510 2.7 (#10115)
Senthil Kumaran [Fri, 26 Oct 2018 08:27:09 +0000 (01:27 -0700)] 
[2.7] bpo-34576 : Backport eeab510 2.7 (#10115)

* bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005)

* Address review comment..
(cherry picked from commit eeab510bb7e51802c18b3770cbb23ae0ca91da6b)

Co-authored-by: Senthil Kumaran <skumaran@gatech.edu>
7 years ago[2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080)
Zackery Spytz [Fri, 26 Oct 2018 05:37:07 +0000 (23:37 -0600)] 
[2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080)

Don't leak a reference if PyDict_Update() fails, check the
PyList_New() call in treebuilder_new(), and properly handle failures
in xmlparser().

(cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654)

7 years ago[2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071)
Zsolt Cserna [Wed, 24 Oct 2018 21:22:27 +0000 (23:22 +0200)] 
[2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071)

Fix the documentation of copy2, as it does not copy file ownership (user and
group), only mode, mtime, atime and flags.

The original text was confusing to developers as it suggested that this
command is the same as 'cp -p', but according to cp(1), '-p' copies file
ownership as well.

Clarify which metadata is copied by shutil.copystat in its docstring.

(cherry picked from commit 4f399be0e70d8b5516b6213568b7665765bb3114)

7 years agobpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072)
Tal Einat [Wed, 24 Oct 2018 17:32:21 +0000 (20:32 +0300)] 
bpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072)

This reverts commit 7829bba.

7 years ago[2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809)
Xiang Zhang [Tue, 23 Oct 2018 06:43:08 +0000 (14:43 +0800)] 
[2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809)

(cherry picked from commit 83a0765)

Co-authored-by: Andrei Petre p31andrei@gmail.com
7 years ago[2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) ...
Serhiy Storchaka [Sun, 21 Oct 2018 07:10:24 +0000 (10:10 +0300)] 
[2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (GH-9968)

(cherry picked from commit 1deea5e53991b46351f6bb395b22365c9455ed88).
(cherry picked from commit bd9c2ce7acaef45f23c2659b854fc9925096d040)

Co-authored-by: Juliette Monsel <j4321@users.noreply.github.com>
7 years agobpo-31500: Default fonts now are scaled on HiDPI displays. (#10015)
Terry Jan Reedy [Sat, 20 Oct 2018 23:34:12 +0000 (19:34 -0400)] 
bpo-31500: Default fonts now are scaled on HiDPI displays. (#10015)

[2.7] bpo-31500: Add idlelib news items about HiDPI scaling

7 years ago[2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585)
Cheryl Sabella [Sat, 20 Oct 2018 20:27:51 +0000 (16:27 -0400)] 
[2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585)

(cherry picked from commit a96c96f5dab68d4e611af4b8caefd7268533fd9a)

7 years agobpo-35032: Remove inaccessible videos from faq/Windows (GH-10004)
Miss Islington (bot) [Sat, 20 Oct 2018 15:32:21 +0000 (08:32 -0700)] 
bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004)

https://bugs.python.org/issue35032
(cherry picked from commit d262250d0732bdf36cb92091e37360cf8ff40f7c)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
7 years agobpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH...
Miss Islington (bot) [Sat, 20 Oct 2018 00:49:37 +0000 (17:49 -0700)] 
bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621)

Add restriction on the offset parameter for mmap.flush.

Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix.
(cherry picked from commit 027664a3d5ebad575aafe5fcc572e3b05f7f24e5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
7 years agobpo-21196: Clarify name mangling rules in tutorial (GH-5667)
Miss Islington (bot) [Sat, 20 Oct 2018 00:45:06 +0000 (17:45 -0700)] 
bpo-21196: Clarify name mangling rules in tutorial (GH-5667)

Initial patch by Chandan Kumar.
(cherry picked from commit 13ae4d44381a647aadd09b70b24833052659be41)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>