Commit Graph

80835 Commits

Author SHA1 Message Date
Zackery Spytz 838645dc41 bpo-10320: Use PY_FORMAT_LONG_LONG in ctypes' PyCArg_repr(). (GH-11230) 2018-12-19 08:01:38 +02:00
Miss Islington (bot) 53e2248a94
bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(). (GH-10853)
Use "ll" instead of the nonstandard "q".
(cherry picked from commit 062cbb6772)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-18 15:51:04 -08:00
Victor Stinner ea6b322829
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 17d0c0595e)
2018-12-18 17:34:51 +01:00
Victor Stinner 34b7c438b8
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 3a8f4fef4a)
2018-12-14 13:44:08 +01:00
Victor Stinner 16d63202af
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.
2018-12-12 12:05:59 +01:00
Victor Stinner d336b1c8a4
bpo-11617: Try to strengthen test_httpservers (GH-11121)
(cherry picked from commit cb342182ee)
2018-12-11 17:08:02 +01:00
Ned Deily d0d09b511d
[2.7] bpo-15663: the 10.6+ macOS installers for 3.6/2.7 now provide a private Tcl/Tk 8.6 (GH-11110) 2018-12-11 04:33:56 -05:00
Miss Islington (bot) aa58050843
bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)
(cherry picked from commit 7cf3d8e251)

Co-authored-by: Ned Deily <nad@python.org>
2018-12-10 22:39:34 -08:00
Miss Islington (bot) 55076cc0ff
[3.6] bpo-35401: Update macOS installer to OpenSSL 1.0.2q (GH-11095)
https://bugs.python.org/issue35401
(cherry picked from commit 419b5ffc2c)

Co-authored-by: Ned Deily <nad@python.org>
2018-12-10 21:54:04 -08:00
Steve Dower 3c8bd22b8f
bpo-35401: Updates Windows build to OpenSSL 1.0.2q (GH-11089) 2018-12-10 20:26:33 -08:00
Victor Stinner 2632df4c3f
[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.
2018-12-10 16:01:03 +01:00
Victor Stinner 1fd93ff18c
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.
2018-12-10 13:53:38 +01:00
Miss Islington (bot) 7bbf7b02ab
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 cf247359d5)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-10 03:38:55 -08:00
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