Commit Graph

80972 Commits

Author SHA1 Message Date
Victor Stinner cecf313d1e
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 8e04186889)
2018-12-10 11:56:54 +01:00
Serhiy Storchaka 324e179009
[2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) (GH-11008)
(cherry picked from commit 42b1d6127b)
(cherry picked from commit 7a2cf1e7d3)
2018-12-07 08:02:33 +02:00
Miss Islington (bot) 107b27eee0
Add missing period in distutils.dep_util.newer_group doc (GH-11003)
(cherry picked from commit c9566b8c45)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-06 13:34:15 -08:00
Victor Stinner 49cedc51a6
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).
2018-12-06 11:56:00 +01:00
native-api 29a4cbff92 [2.7] bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278) (GH-7279) 2018-12-06 11:43:37 +02:00
Andre Delfino 46aa472a8f [2.7] Correct a couple of unbalanced parenthesis. (GH-10779). (GH-10963)
(cherry picked from commit 55f41e45b4)
2018-12-06 11:19:23 +02:00
Victor Stinner 358fc87f53
Revert "[2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686)" (GH-10970)
This reverts commit 4a7dd30f58.
2018-12-06 01:49:41 +01:00
Miss Islington (bot) 40ef5b73c2
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 2d8f976cde)

Co-authored-by: E Kawashima <e-kwsm@users.noreply.github.com>
2018-12-05 14:31:11 -08:00
Serhiy Storchaka fff8fab1ce
[2.7] bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946) (GH-10955)
(cherry picked from commit 5b25f1d031)
(cherry picked from commit 1de91a0032)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>.
2018-12-06 00:21:40 +02:00
Serhiy Storchaka b2742ba5f9
[2.7] bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419). (GH-10950)
(cherry picked from commit 67a93b3a0b)
2018-12-06 00:02:10 +02:00
Serhiy Storchaka abe74feb91
[2.7] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565). (GH-10943)
(cherry picked from commit 4edeaeac4c)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-12-05 23:10:36 +02:00
Andre Delfino c6639cda51 [2.7] Move __missing__ after __delitem__ in Data model. (GH-10923). (GH-10944)
(cherry picked from commit 1ce853f377)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-05 23:09:25 +02:00
Victor Stinner b50b33b4ac
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 f2f4555d82)
2018-12-05 21:56:24 +01:00
Miss Islington (bot) bacc272afc
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 54fd45505b)

Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
2018-12-05 12:04:57 -08:00
Miss Islington (bot) c7976da5c2
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 c11b3b19a5)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-04 17:22:02 -08:00
Serhiy Storchaka 93d7918f77
[2.7] bpo-16865: Support arrays >=2GB in ctypes. (GH-3006). (GH-7441)
(cherry picked from commit 735abadd5b)

Co-Authored-By: Segev Finer <segev208@gmail.com>
2018-12-04 12:38:07 +02:00
Serhiy Storchaka eab421bff9
[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 fdb5a50ef3)
2018-12-04 12:02:48 +02:00
Victor Stinner 8687bd86e6
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 ba7c226095)
2018-12-03 16:49:24 +01:00
Victor Stinner c275be5441
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().
2018-12-03 12:29:29 +01:00
E Kawashima dfd4a1d841 [2.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10827)
(cherry picked from commit b7c2182604)
2018-12-01 14:16:00 +02:00
Victor Stinner 2212ee2bee
Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833)
Fix DeprecationWarning when tests are run using python -3.
2018-11-30 20:45:04 +01:00
Victor Stinner bc9f53f69e
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.
2018-11-30 18:08:02 +01:00
Victor Stinner 8f83c2fb19
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 9eea6eaf23)
2018-11-30 17:04:35 +01:00
Victor Stinner dab59fa560
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 ebd5d6d6e6)
2018-11-30 13:02:41 +01:00
Victor Stinner d7a880c3c2
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.
2018-11-30 11:04:42 +01:00
Miss Islington (bot) f3fe21a3ca
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
(cherry picked from commit a2e3585e79)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-30 00:04:43 -08:00
Victor Stinner f681e93e46
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.
2018-11-29 23:38:35 +01:00
Victor Stinner 36003003f2
bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801)
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
2018-11-29 21:14:42 +01:00
Benjamin Peterson 2e869a8f82
closes bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788) 2018-11-29 01:37:15 -06:00
Victor Stinner 22338f3f8b
pythoninfo: log more environment variable (GH-10719) (GH-10774)
Log TZ to debug a timezone issue... and a few more :-)

(cherry picked from commit 282c03d45d)
2018-11-28 21:12:54 +01:00
Miss Islington (bot) 0ef0398dcf
Linkify SMTP.quit() in smtplib documentation. (GH-9785)
(cherry picked from commit ba57963a95)

Co-authored-by: takey <taketakeyyy@gmail.com>
2018-11-23 09:01:31 -08:00
Julien Palard daa34b84e9 [2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) (GH-10667)
https://bugs.python.org/issue35035
2018-11-22 14:18:05 -08:00
Miss Islington (bot) fcbcebadff
bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558)
(cherry picked from commit 6b73bb523a)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-11-21 14:47:10 -08:00
Serhiy Storchaka 40fdf47193
[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 3ec0f49516)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-20 21:56:34 +02:00
Miss Islington (bot) 4845aa6ef8 Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)
(cherry picked from commit 8b9c33ea9c)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-11-19 08:07:58 -05:00
Miss Islington (bot) e45fa7393b
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 ad65f15581)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-16 08:32:07 -08:00
Miss Islington (bot) 2907d93889
Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)
"single" needs to be decrefed if PyList_Append() fails.
(cherry picked from commit 4c596d54aa)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-15 01:25:58 -08:00
Gregory P. Smith b6f4472dc4
[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]
2018-11-14 11:55:07 -08:00
Andrés Delfino 815fa49d10 [2.7] Grammar corrections in abc.rst (GH-10525). (GH-10535)
(cherry picked from commit 8e0b05e2f4)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-13 17:08:09 -08:00
Miss Islington (bot) 6042f462cf
Linkify PEP 8 in unix.rst (GH-10482)
(cherry picked from commit 9404e7737b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-12 08:52:13 -08:00
Andrés Delfino fb8eb2c277 [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 b086c8afdb)



https://bugs.python.org/issue33699
2018-11-11 12:09:03 -08:00
Alexey Izbyshev 0d165262d9 [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 7a69cf47a9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-10 07:47:12 +02:00
Julien Palard 18ba4851ae [2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410) 2018-11-08 00:09:38 -08:00
Miss Islington (bot) 842efd0087
Add future_stmt to simple_stmt production list. (GH-8239)
(cherry picked from commit cdb96f45b6)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 21:16:15 -08:00
Miss Islington (bot) 322f8bc68c
glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)
(cherry picked from commit ae31e3fbf4)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:30:31 -08:00
Miss Islington (bot) d06b60fca3
Add a reference to the name mangling description in the tutorial to the index. (GH-10138)
(cherry picked from commit c5eec4426d)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:30:12 -08:00
Miss Islington (bot) 830f26d11e
Correct grammar mistakes in string.rst. (GH-9752)
(cherry picked from commit d64991031e)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:55:07 -08:00
Miss Islington (bot) ffbce43c1a
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 f1b9ad3d38)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-05 20:59:07 -08:00
Serhiy Storchaka 3e3e1a27f7
[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 34fd4c2019)
(cherry picked from commit 7054e5c80b)
2018-11-05 18:16:26 +02:00
Stéphane Wirtel 6bf85acf60 [2.7] Docs: fix some wrong words (GH-6987) (GH-10315) 2018-11-04 14:38:50 -05:00