Commit Graph

102296 Commits

Author SHA1 Message Date
Miss Islington (bot) 3451078190
bpo-35310: Clear select() lists before returning upon EINTR (GH-10877)
select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415a6d)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
2018-12-05 13:31:07 -08:00
Serhiy Storchaka ac8b47c8b4
bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165). (GH-10947)
(cherry picked from commit 34c7f0c04e)

Co-authored-by: William Grzybowski <wg@FreeBSD.org>
2018-12-05 23:23:06 +02:00
Serhiy Storchaka 1de91a0032
bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946)
(cherry picked from commit 5b25f1d031)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-12-05 23:09:56 +02:00
Miss Islington (bot) 53bed18d93
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
(cherry picked from commit 67a93b3a0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-05 12:29:31 -08:00
Miss Islington (bot) 349d9910b2
Correct a couple of unbalanced parenthesis. (GH-10779)
(cherry picked from commit 55f41e45b4)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-05 12:15:54 -08:00
Miss Islington (bot) d2c7c1f768
Move __missing__ after __delitem__ in Data model. (GH-10923)
(cherry picked from commit 1ce853f377)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-05 12:11:16 -08:00
Miss Islington (bot) c7c4e938b9
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 11:54:42 -08:00
Miss Islington (bot) e2f376f284
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)
(cherry picked from commit 25d389789c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-05 11:35:41 -08:00
Miss Islington (bot) 983d1ab0e6
bpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919)
* 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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-05 08:07:57 -08:00
Miss Islington (bot) 2d594f8578
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
(cherry picked from commit 2a893430c9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-04 23:51:08 -08:00
Victor Stinner c93e3b05d5
bpo-35363, test_eintr: skip test_open() on macOS (GH-10896) (GH-10911)
(cherry picked from commit 4752e65250)
2018-12-05 03:03:28 +01:00
Miss Islington (bot) 74a80e1ed0
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:16:39 -08:00
Victor Stinner b02774f421
bpo-35296: make install now installs the internal API (GH-10665) (GH-10897)
* bpo-35296: make install now installs the internal API (GH-10665)

make install now also installs the internal API: Include/internal/*.h
header files.

(cherry picked from commit f653fd4d95)

* Windows installer now also install Include/internal/

The Windows installer (MSI) now also install header files of the
Include/internal/ subdirectory.
2018-12-04 21:28:28 +01:00
Miss Islington (bot) 0091f349cd bpo-29564: warnings suggests to enable tracemalloc (GH-10486) (GH-10509)
The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.
(cherry picked from commit 2c07c493d2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-04 21:25:57 +01:00
Miss Islington (bot) 1751423686
bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.
(cherry picked from commit f92c7aa1ae)

Co-authored-by: stratakis <cstratak@redhat.com>
2018-12-04 07:06:16 -08:00
Miss Islington (bot) 12735c1413 bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (GH-10873) (#10887)
Fix minor typo in test function name.
(cherry picked from commit e63e617ebb)

Co-authored-by: Andrew Dunai <andunai@gmail.com>
2018-12-04 09:34:34 +00:00
Miss Islington (bot) 6627d3ae1e
bpo-35395: fix typos in asyncio eventloop documentation (GH-10880)
Fixes `loop.add_writer` and `loop.add_signal_handler` method documentation to correctly reference the callback parameter from method signature.

https://bugs.python.org/issue35395
(cherry picked from commit 1747334794)

Co-authored-by: Naglis <naglis@users.noreply.github.com>
2018-12-03 23:36:31 -08:00
Victor Stinner 5eb78c7512
[3.7] bpo-35373: Fix PyInit_timezone() error handling (GH-10864)
* bpo-35373: Fix PyInit_timezone() error handling

PyInit_timezone() now returns -1 at exit if an exception is raised.
Check also explicitly PyUnicode_DecodeLocale() and Py_BuildValue()
errors.

* bpo-35373: Fix PyInit_time() error handling (GH-10865)

* PyInit_time() now returns NULL if an exception is raised.
* Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is
  a special prefix for function initializing a module.
  init_timezone() doesn't initialize a module and the function is not
  exported.

(cherry picked from commit 3bb150d814)
2018-12-04 00:09:02 +01:00
Miss Islington (bot) e8f9e4785c bpo-35226: Fix equality for nested unittest.mock.call objects. (GH-10555)
Also refactor the call recording imolementation and add some notes
about its limitations.
(cherry picked from commit 8ca0fa9d2f)

Co-authored-by: Chris Withers <chris@withers.org>
2018-12-03 21:54:44 +00:00
Miss Islington (bot) fe91e9ba08 [3.7] bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867) (GH-10872)
* bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867)
(cherry picked from commit 3bc0ebab17)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-12-03 23:11:41 +02:00
Miss Islington (bot) a9f435e5d8
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-03 01:11:30 -08:00
Miss Islington (bot) bdeb56cd21
bpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)
(cherry picked from commit 4013c17911)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-03 01:09:11 -08:00
Miss Islington (bot) 1ef06c62d3 bpo-32153: Add unit test for create_autospec with partial function returned in getattr (GH-10398) (#10855)
* Add create_autospec with partial function returned in getattr

* Use self.assertFalse instead of assert

* Use different names and remove object
(cherry picked from commit c667b094ae)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-12-03 08:26:06 +00:00
Miss Islington (bot) 6cb0486ce8
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)
(cherry picked from commit 68b56d02ef)

Co-authored-by: Ismo Toijala <ismo.toijala@gmail.com>
2018-12-02 08:14:44 -08:00
Miss Islington (bot) 265b41996a
bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)
(cherry picked from commit 32bc11c33c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-01 04:52:04 -08:00
E Kawashima 7da9755021 [3.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10824)
(cherry picked from commit b7c2182604)
2018-12-01 14:19:39 +02:00
Miss Islington (bot) 422c1658b7
bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)
(cherry picked from commit edeca92c84)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-12-01 02:24:47 -08:00
Victor Stinner 38c06d9193
get_gmtoff() now returns time_t (GH-10838) (GH-10839)
get_gmtoff() now returns time_t instead of int to fix the following
Visual Studio warning:

    Modules\timemodule.c(1183): warning C4244: 'return':
    conversion from 'time_t' to 'int', possible loss of data

(cherry picked from commit 503ce5c482)
2018-12-01 01:24:21 +01:00
Victor Stinner 38bed786a2
[3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10834)
* bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)

Modify asyncio tests to utilize the certificates from the test directory
instead of its own set, as they are the same and with each update they had
to be updated as well.

(cherry picked from commit b062ba77b6)

* bpo-35352: Cleanup test_asyncio/utils.py (GH-10831)

'here' variable is no longer needed.

(cherry picked from commit 7212148c95)
2018-11-30 20:44:27 +01:00
Miss Islington (bot) b1355352d1
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)
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)

Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
2018-11-30 07:32:12 -08:00
Miss Islington (bot) 365f21c2d3
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
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()
* Expect specific BlockingIOError rather than generic OSError
* Add a timeout to select() in testAccept() and testRecv()
* Use addCleanup() to close sockets
* Use assertRaises()
(cherry picked from commit ebd5d6d6e6)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-30 03:48:17 -08:00
Victor Stinner df738d56fe
bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813)
Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C
locale if the LC_CTYPE locale is "C".

(cherry picked from commit 55e498058f)
2018-11-30 12:19:48 +01:00
Miss Islington (bot) 0df1f4576e
Fix typo in Memory Management doc. (GH-10798)
(cherry picked from commit a407004391)

Co-authored-by: Kevin Adler <kadler@us.ibm.com>
2018-11-30 00:05:51 -08:00
Miss Islington (bot) e604b6c53e
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:00:07 -08:00
Victor Stinner 8a73cac618
[3.7] bpo-34279: Synchronize regrtest with master (GH-10800)
* bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)

Rename also run_tests_slave() to run_tests_worker().

(cherry picked from commit 012f5b968a)

* bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150)

(cherry picked from commit 9724348b43)

* test_regrtest: remove unused threading import
2018-11-29 21:14:59 +01:00
Miss Islington (bot) 1659c08d5d
bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751)
Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts.
(cherry picked from commit 1c607155c9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-29 06:27:49 -08:00
Victor Stinner 7eeab87263
bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792)
Fix ResourceWarning in platform.dist() and
platform.linux_distribution() on SuSE and Caldera OpenLinux.

Patch by Ville Skyttä.
2018-11-29 12:31:08 +01:00
Miss Islington (bot) e754159ef0 bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789)
PyType_GetFlags() return type is unsigned long, not long.
(cherry picked from commit 9fbcfc08e5)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
2018-11-29 12:07:33 +01:00
Miss Islington (bot) 2fa5b2ac44
bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
test_eintr no longer fails if the signal handler has not been called.
(cherry picked from commit 2956bffbc0)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-28 16:52:11 -08:00
Miss Islington (bot) d46d753d15
bpo-33723: Remove busy loop from test_time (GH-10773)
The "busy loops" of test_process_time() and test_thread_time() are
not reliable and fail randomly on Windows: remove them.
(cherry picked from commit 48498dd57f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-28 09:58:31 -08:00
Miss Islington (bot) 24b51b1a49
bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in
3.7.0 in bpo-29708.  The change is bad, as it unconditionally overrides
*invalidation_mode*, even if it was passed as an explicit argument to
``py_compile.compile()`` or ``compileall``.  An environment variable
should *never* override an explicit argument to a library function.
That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH``
environment variable is set.

This changes ``py_compile.compile()`` to only look at
``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified.
I also made various relevant tests run with explicit control over the
value of ``SOURCE_DATE_EPOCH``.

While looking at this, I noticed that ``zipimport`` does not work
with hash-based .pycs _at all_, though I left the fixes for
subsequent commits.
(cherry picked from commit a6b3ec5b6d)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-11-28 09:45:36 -08:00
Ismo Toijala f71a592291 bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772) 2018-11-28 17:22:09 +00:00
Victor Stinner c9010456d4
pythoninfo: log more environment variable (GH-10719) (GH-10769)
Log TZ to debug a timezone issue... and a few more :-)

(cherry picked from commit 282c03d45d)
2018-11-28 18:04:30 +01:00
Julien Palard 9c16bc2c3d [3.7] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10767) 2018-11-28 07:53:23 -08:00
Victor Stinner 85ab974f78
bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761)
Fix memory leak in PyUnicode_EncodeLocale() and
PyUnicode_EncodeFSDefault() on error handling.

Fix unicode_encode_locale() error handling.

(cherry picked from commit bde9d6bbb4)
2018-11-28 12:42:40 +01:00
Miss Islington (bot) 80db40cdd6
bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)
Fix WithThreadsTestPool.test_wrapped_exception()
of test_multiprocessing_fork: join the pool.

WithThreadsTestPool.test_del_pool() is now also decorated
with @support.reap_threads.
(cherry picked from commit b7278736b3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-27 16:30:34 -08:00
Serhiy Storchaka ad8ac54aa3
bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)
(cherry picked from commit 81524022d0)
2018-11-27 20:27:47 +02:00
Miss Islington (bot) 5ceb7018dc
bpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-27 09:58:07 -08:00
Miss Islington (bot) d669154ee5
bpo-35317: Fix mktime() error in test_email (GH-10721)
Fix mktime() overflow error in test_email: run
test_localtime_daylight_true_dst_true() and
test_localtime_daylight_false_dst_true() with a specific timezone.
(cherry picked from commit cfaafda8e3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-27 03:57:56 -08:00
Victor Stinner 7f9fb0f345
bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10738)
Copy code from master: add assertions on start and value, replace 'i'
iterator with 'end' pointer for the loop stop condition.

_PyUnicode_FastFill(): fix type of 'data', it must not be constant,
since data is modified by FILL().
2018-11-27 12:42:04 +01:00