Commit Graph

102272 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 716a8089b0
closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)
(cherry picked from commit da324d53d4)

Co-authored-by: E. M. Bray <erik.m.bray@gmail.com>
2018-11-26 18:32:57 -08:00
Miss Islington (bot) 2a37f013ec
bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693)
Regression introduced in e3ce695 and 25b804a, where the old parameter
update_tryorder to _synthesize was first ignored, then given the opposite
value in the attempt to fix bpo-31014.
(cherry picked from commit 8c281ed403)

Co-authored-by: Zhiming Wang <i@zhimingwang.org>
2018-11-26 13:49:28 -08:00
Miss Islington (bot) 5350dd1b50
bpo-33723: Fix test_time.test_thread_time() (GH-10724)
Tolerate up to 30 ms, instead of 15 min, in other threads.
(cherry picked from commit 65c216e74f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-26 12:36:54 -08:00
Julien Palard 6f8cab0db0 [3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722)
(cherry picked from commit 5719f275b7)

Co-authored-by: Mathieu Dupuy <deronnax@users.noreply.github.com>





https://bugs.python.org/issue35255
2018-11-26 09:05:48 -08:00
Victor Stinner 6f5fa1b4be
bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718)
Fix str.format(), float.__format__() and complex.__format__() methods
for non-ASCII decimal point when using the "n" formatter.

Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires
a _PyUnicodeWriter object for the buffer and a Python str object
for digits.

(cherry picked from commit 59423e3ddd)
2018-11-26 14:17:01 +01:00
Victor Stinner e88553c374
bpo-35313: Fix test_embed when run from venv (GH-10713) (GH-10715)
test_embed.InitConfigTests now gets the expected configuration from
a child process run with -S to not run the site module.

(cherry picked from commit a6537fb7c2)
2018-11-26 12:42:06 +01:00
Miss Islington (bot) c707400727 bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708) 2018-11-25 17:00:37 -08:00
Miss Islington (bot) 6a528ccb4c closes bpo-35309: cpath should be capath (GH-10701)
(cherry picked from commit 158695817d)

Co-authored-by: Boštjan Mejak <bostjan.xperia@gmail.com>
2018-11-25 14:51:02 -06:00
Miss Islington (bot) 89a3087d40
bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592)
(cherry picked from commit 4bb186d7e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-25 01:30:37 -08:00
Miss Islington (bot) bc665b42ba
bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689)
(cherry picked from commit 5b83ef71d3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-23 11:58:08 -08:00
Miss Islington (bot) 903a3e8d67
bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
Importing ProcessPoolExecutor may hang or cause an error when the import
accesses urandom on a low resource platform

https://bugs.python.org/issue29877
(cherry picked from commit 1d817e4c82)

Co-authored-by: Dustin Spicuzza <dustin@virtualroadside.com>
2018-11-23 09:41:54 -08:00
Miss Islington (bot) 01e579949a
bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675)
The "-I" command line option (run Python in isolated mode) is now
also copied by the multiprocessing and distutils modules when
spawning child processes. Previously, only -E and -s options (enabled
by -I) were copied.

subprocess._args_from_interpreter_flags() now copies the -I flag.
(cherry picked from commit 9de3632715)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-23 09:13:32 -08:00
Miss Islington (bot) 70cc092340
Linkify SMTP.quit() in smtplib documentation. (GH-9785)
(cherry picked from commit ba57963a95)

Co-authored-by: takey <taketakeyyy@gmail.com>
2018-11-23 08:59:05 -08:00
Victor Stinner 56742f1eb0
[3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678)
* bpo-35189: Fix eintr_tester.py (GH-10637)

Call setitimer() before each test method, instead of once per test
case, to ensure that signals are sent in each test method.
Previously, only the first method of a testcase class got signals.

Changes:

* Replace setUpClass() with setUp() and replace tearDownClass() with
  tearDown().
* tearDown() now ensures that at least one signal has been sent.
* Replace support.run_unittest() with unittest.main() which has
  a nicer CLI and automatically discover test cases.

(cherry picked from commit aac1f81eef)

* bpo-35189: Retry fnctl calls on EINTR (GH-10413)

Modify the following fnctl function to retry if interrupted by a signal
(EINTR): flock, lockf, fnctl.

(cherry picked from commit b409ffa848)
Co-Authored-By: nierob <nierob@users.noreply.github.com>
2018-11-23 17:53:14 +01:00
Victor Stinner f6e323ce32
bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673)
bpo-34523, bpo-35290: C locale coercion now resets the Python
internal "force ASCII" mode. This change fix the filesystem encoding
on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when
the UTF-8 mode is disabled.

Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.

(cherry picked from commit 353933e712)
2018-11-23 13:37:42 +01:00
Victor Stinner 95036ea25d
[3.7] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662)
* bpo-9263: _PyObject_Dump() detects freed memory (GH-10061)

_PyObject_Dump() now uses an heuristic to check if the object memory
has been freed: log "<freed object>" in that case.

The heuristic rely on the debug hooks on Python memory allocators
which fills the memory with DEADBYTE (0xDB) when memory is
deallocated. Use PYTHONMALLOC=debug to always enable these debug
hooks.

(cherry picked from commit 82af0b63b0)

* bpo-9263: Fix _PyObject_Dump() for freed object (#10661)

If _PyObject_Dump() detects that the object is freed, don't try to
dump it (exit immediately).

Enhance also _PyObject_IsFreed(): it now detects if the pointer
itself looks like freed memory.

(cherry picked from commit 2cf5d32fd9)
2018-11-22 17:15:37 +01:00
Victor Stinner a519411573
Revert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660)
This reverts commit d2be9a5c13.
2018-11-22 16:11:15 +01:00
Miss Islington (bot) 18f3327d9a
bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)
os_read_impl() now also truncates the size to _PY_READ_MAX
on macOS, to avoid to allocate a larger buffer even if _Py_read() is
limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS).
(cherry picked from commit 9a0d7a7648)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-22 06:17:34 -08:00
Miss Islington (bot) df6374e15a
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:46:30 -08:00
Miss Islington (bot) 3b7258a5a5 [3.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023)
I'll watch for 404 on the old URL and will setup an HTTP redirection if needed.
(cherry picked from commit 361e8683e7)

Co-authored-by: Zhiming Wang <github@zmwang.pw>
2018-11-21 13:54:17 +01:00
Miss Islington (bot) d170e594b2 bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10629)
(cherry picked from commit d936a8f8e0)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-11-21 00:48:57 -08:00
Miss Islington (bot) 129642a1ff
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
(cherry picked from commit c8fe9ccf7b)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
2018-11-20 13:48:34 -08:00
Victor Stinner 6eff6b8eec
bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619)
locale.localeconv() now sets temporarily the LC_CTYPE locale to the
LC_MONETARY locale if the two locales are different and monetary
strings are non-ASCII. This temporary change affects other threads.

Changes:

* locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode
  monetary fields.
* Add LocaleInfo.grouping_buffer: copy localeconv() grouping string
  since it can be replaced anytime if a different thread calls
  localeconv().

(cherry picked from commit 02e6bf7f20)
2018-11-20 22:06:21 +01:00
Miss Islington (bot) d57ab8ac18
bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)
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 10:59:12 -08:00