]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 years agobpo-35310: Clear select() lists before returning upon EINTR (GH-10877)
Miss Islington (bot) [Wed, 5 Dec 2018 21:31:07 +0000 (13:31 -0800)] 
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 7f52415a6d4841d77d3b7853e83b25a22e0048dc)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
6 years agobpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165...
Serhiy Storchaka [Wed, 5 Dec 2018 21:23:06 +0000 (23:23 +0200)] 
bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165). (GH-10947)

(cherry picked from commit 34c7f0c04e2b4e715b2c3df1875af8939fbe7d0b)

Co-authored-by: William Grzybowski <wg@FreeBSD.org>
6 years agobpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113...
Serhiy Storchaka [Wed, 5 Dec 2018 21:09:56 +0000 (23:09 +0200)] 
bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946)

(cherry picked from commit 5b25f1d03100e2283c1b129d461ba68ac0169a14)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
6 years agobpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
Miss Islington (bot) [Wed, 5 Dec 2018 20:29:31 +0000 (12:29 -0800)] 
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)

(cherry picked from commit 67a93b3a0b3814e97ef9d077b21325fc8ce351b2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agoCorrect a couple of unbalanced parenthesis. (GH-10779)
Miss Islington (bot) [Wed, 5 Dec 2018 20:15:54 +0000 (12:15 -0800)] 
Correct a couple of unbalanced parenthesis. (GH-10779)

(cherry picked from commit 55f41e45b4318cbe19209f5144641344d0049fb8)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
6 years agoMove __missing__ after __delitem__ in Data model. (GH-10923)
Miss Islington (bot) [Wed, 5 Dec 2018 20:11:16 +0000 (12:11 -0800)] 
Move __missing__ after __delitem__ in Data model. (GH-10923)

(cherry picked from commit 1ce853f37783575e2b3aaa159ddcebc8660830ef)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
6 years agobpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)
Miss Islington (bot) [Wed, 5 Dec 2018 19:54:42 +0000 (11:54 -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>
6 years agobpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce()....
Miss Islington (bot) [Wed, 5 Dec 2018 19:35:41 +0000 (11:35 -0800)] 
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)

(cherry picked from commit 25d389789c59a52a31770f7c50ce9e02a8909190)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919)
Miss Islington (bot) [Wed, 5 Dec 2018 16:07:57 +0000 (08:07 -0800)] 
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 f2f4555d8287ad217a1dba7bbd93103ad4daf3a8)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
Miss Islington (bot) [Wed, 5 Dec 2018 07:51:08 +0000 (23:51 -0800)] 
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)

(cherry picked from commit 2a893430c9c8378cbdfac95895a64fa07aaff9ed)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-35363, test_eintr: skip test_open() on macOS (GH-10896) (GH-10911)
Victor Stinner [Wed, 5 Dec 2018 02:03:28 +0000 (03:03 +0100)] 
bpo-35363, test_eintr: skip test_open() on macOS (GH-10896) (GH-10911)

(cherry picked from commit 4752e65250bce60b97d5af702d586092d02fbf58)

6 years agobpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)
Miss Islington (bot) [Wed, 5 Dec 2018 01:16:39 +0000 (17:16 -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>
6 years agobpo-35296: make install now installs the internal API (GH-10665) (GH-10897)
Victor Stinner [Tue, 4 Dec 2018 20:28:28 +0000 (21:28 +0100)] 
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 f653fd4d950ac092719b6152e38d77c62b443125)

* Windows installer now also install Include/internal/

The Windows installer (MSI) now also install header files of the
Include/internal/ subdirectory.

6 years agobpo-29564: warnings suggests to enable tracemalloc (GH-10486) (GH-10509)
Miss Islington (bot) [Tue, 4 Dec 2018 20:25:57 +0000 (12:25 -0800)] 
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 2c07c493d2eb45101312e3eb3a77f94d0c9cad1f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
Miss Islington (bot) [Tue, 4 Dec 2018 15:06:16 +0000 (07:06 -0800)] 
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 f92c7aa1ae81efa475b5aecf66e4711ef0f52c4c)

Co-authored-by: stratakis <cstratak@redhat.com>
6 years agobpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy...
Miss Islington (bot) [Tue, 4 Dec 2018 09:34:34 +0000 (01:34 -0800)] 
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 e63e617ebbe481c498bdf037a62e09f4f9f3963f)

Co-authored-by: Andrew Dunai <andunai@gmail.com>
6 years agobpo-35395: fix typos in asyncio eventloop documentation (GH-10880)
Miss Islington (bot) [Tue, 4 Dec 2018 07:36:31 +0000 (23:36 -0800)] 
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 17473347942353946fe455f797a2197cb89c1090)

Co-authored-by: Naglis <naglis@users.noreply.github.com>
6 years ago[3.7] bpo-35373: Fix PyInit_timezone() error handling (GH-10864) 10883/head
Victor Stinner [Mon, 3 Dec 2018 23:09:02 +0000 (00:09 +0100)] 
[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 3bb150d8148e3cc08418077a58f43e064b9fde61)

6 years agobpo-35226: Fix equality for nested unittest.mock.call objects. (GH-10555)
Miss Islington (bot) [Mon, 3 Dec 2018 21:54:44 +0000 (13:54 -0800)] 
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 8ca0fa9d2f4de6e69f0902790432e0ab2f37ba68)

Co-authored-by: Chris Withers <chris@withers.org>
6 years ago[3.7] bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867) (GH-10872)
Miss Islington (bot) [Mon, 3 Dec 2018 21:11:41 +0000 (13:11 -0800)] 
[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 3bc0ebab17bf5a2c29d2214743c82034f82e6573)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
6 years agobpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(... 10869/head
Miss Islington (bot) [Mon, 3 Dec 2018 09:11:30 +0000 (01:11 -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>
6 years agobpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)
Miss Islington (bot) [Mon, 3 Dec 2018 09:09:11 +0000 (01:09 -0800)] 
bpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)

(cherry picked from commit 4013c179117754b039957db4730880bf3285919d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agobpo-32153: Add unit test for create_autospec with partial function returned in getatt...
Miss Islington (bot) [Mon, 3 Dec 2018 08:26:06 +0000 (00:26 -0800)] 
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 c667b094ae37799a7e42ba5cd2ad501cc7920888)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
6 years agobpo-35341: Add generic version of OrderedDict to typing (GH-10850)
Miss Islington (bot) [Sun, 2 Dec 2018 16:14:44 +0000 (08:14 -0800)] 
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)

(cherry picked from commit 68b56d02ef20479b87c65e523cf3dec1b7b77d40)

Co-authored-by: Ismo Toijala <ismo.toijala@gmail.com>
6 years agobpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)
Miss Islington (bot) [Sat, 1 Dec 2018 12:52:04 +0000 (04:52 -0800)] 
bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)

(cherry picked from commit 32bc11c33cf5ccea165b5f4ac3799f02fdf9c76a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years ago[3.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10824)
E Kawashima [Sat, 1 Dec 2018 12:19:39 +0000 (21:19 +0900)] 
[3.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10824)

(cherry picked from commit b7c2182604d5796b5af4c837991aa0b8c8a2d41f)

6 years agobpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)
Miss Islington (bot) [Sat, 1 Dec 2018 10:24:47 +0000 (02:24 -0800)] 
bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)

(cherry picked from commit edeca92c84a3b08902ecdfe987cde00c7e617887)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
6 years agoget_gmtoff() now returns time_t (GH-10838) (GH-10839)
Victor Stinner [Sat, 1 Dec 2018 00:24:21 +0000 (01:24 +0100)] 
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 503ce5c482cb267b0770bc46c315d5cf822bdca9)

6 years ago[3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH...
Victor Stinner [Fri, 30 Nov 2018 19:44:27 +0000 (20:44 +0100)] 
[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 b062ba77b617b0f89b7ea25d14cc77c991462ad4)

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

'here' variable is no longer needed.

(cherry picked from commit 7212148c95947b0fdfcb0c8e37d4357287bdb4bd)

6 years agobpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)
Miss Islington (bot) [Fri, 30 Nov 2018 15:32:12 +0000 (07:32 -0800)] 
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 9eea6eaf23067880f4af3a130e3f67c9812e2f30)

Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
6 years agobpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
Miss Islington (bot) [Fri, 30 Nov 2018 11:48:17 +0000 (03:48 -0800)] 
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 ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813)
Victor Stinner [Fri, 30 Nov 2018 11:19:48 +0000 (12:19 +0100)] 
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 55e498058faf8c97840556f6d791c2c392732dc3)

6 years agoFix typo in Memory Management doc. (GH-10798)
Miss Islington (bot) [Fri, 30 Nov 2018 08:05:51 +0000 (00:05 -0800)] 
Fix typo in Memory Management doc. (GH-10798)

(cherry picked from commit a40700439195a119878150f4f0d425c42ca957ef)

Co-authored-by: Kevin Adler <kadler@us.ibm.com>
6 years agobpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
Miss Islington (bot) [Fri, 30 Nov 2018 08:00:07 +0000 (00:00 -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>
6 years ago[3.7] bpo-34279: Synchronize regrtest with master (GH-10800)
Victor Stinner [Thu, 29 Nov 2018 20:14:59 +0000 (21:14 +0100)] 
[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 012f5b968a738b15ae9b40c499a1c0778b0615a9)

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

(cherry picked from commit 9724348b43a9005a449ba532ccd3c6726f031097)

* test_regrtest: remove unused threading import

6 years agobpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751)
Miss Islington (bot) [Thu, 29 Nov 2018 14:27:49 +0000 (06:27 -0800)] 
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 1c607155c9e363489036ae6258b165a3fae75134)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agobpo-27903: Fix ResourceWarning in platform.dist() (GH-10792)
Victor Stinner [Thu, 29 Nov 2018 11:31:08 +0000 (12:31 +0100)] 
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ä.

6 years agobpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789)
Miss Islington (bot) [Thu, 29 Nov 2018 11:07:33 +0000 (03:07 -0800)] 
bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789)

PyType_GetFlags() return type is unsigned long, not long.
(cherry picked from commit 9fbcfc08e5814d7aa9287740187e461425a99f67)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
6 years agobpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
Miss Islington (bot) [Thu, 29 Nov 2018 00:52:11 +0000 (16:52 -0800)] 
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 2956bffbc00127af65f69e04d7979021a21d1288)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-33723: Remove busy loop from test_time (GH-10773)
Miss Islington (bot) [Wed, 28 Nov 2018 17:58:31 +0000 (09:58 -0800)] 
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 48498dd57f79ab1d061c754ad6a2ebe1a7172b0e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
Miss Islington (bot) [Wed, 28 Nov 2018 17:45:36 +0000 (09:45 -0800)] 
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 a6b3ec5b6d4f6387820fccc570eea08b9615620d)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
6 years agobpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772)
Ismo Toijala [Wed, 28 Nov 2018 17:22:09 +0000 (19:22 +0200)] 
bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772)

6 years agopythoninfo: log more environment variable (GH-10719) (GH-10769)
Victor Stinner [Wed, 28 Nov 2018 17:04:30 +0000 (18:04 +0100)] 
pythoninfo: log more environment variable (GH-10719) (GH-10769)

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

(cherry picked from commit 282c03d45d2d766c55904a4eb766923a2c459124)

6 years ago[3.7] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH...
Julien Palard [Wed, 28 Nov 2018 15:53:23 +0000 (16:53 +0100)] 
[3.7] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10767)

6 years agobpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761)
Victor Stinner [Wed, 28 Nov 2018 11:42:40 +0000 (12:42 +0100)] 
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 bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6)

6 years agobpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)
Miss Islington (bot) [Wed, 28 Nov 2018 00:30:34 +0000 (16:30 -0800)] 
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 b7278736b3ae158a7738057e3045bc767ced019e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)
Serhiy Storchaka [Tue, 27 Nov 2018 18:27:47 +0000 (20:27 +0200)] 
bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)

(cherry picked from commit 81524022d0c0df7a41f9b2b2df41e2ebe140e610)

6 years agobpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Miss Islington (bot) [Tue, 27 Nov 2018 17:58:07 +0000 (09:58 -0800)] 
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 d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agobpo-35317: Fix mktime() error in test_email (GH-10721)
Miss Islington (bot) [Tue, 27 Nov 2018 11:57:56 +0000 (03:57 -0800)] 
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 cfaafda8e3e19764682abb4bd4c574accb784c42)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10738)
Victor Stinner [Tue, 27 Nov 2018 11:42:04 +0000 (12:42 +0100)] 
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().

6 years agocloses bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)
Miss Islington (bot) [Tue, 27 Nov 2018 02:32:57 +0000 (18:32 -0800)] 
closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)

(cherry picked from commit da324d53d420347344236ff64cf5eb9b675d6f86)

Co-authored-by: E. M. Bray <erik.m.bray@gmail.com>
6 years agobpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693)
Miss Islington (bot) [Mon, 26 Nov 2018 21:49:28 +0000 (13:49 -0800)] 
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 8c281ed403fd915284d5bba2405d7c47f8195066)

Co-authored-by: Zhiming Wang <i@zhimingwang.org>
6 years agobpo-33723: Fix test_time.test_thread_time() (GH-10724) 10730/head
Miss Islington (bot) [Mon, 26 Nov 2018 20:36:54 +0000 (12:36 -0800)] 
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 65c216e74f7957006ef7653b7e2afe83007c45ce)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years ago[3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722)
Julien Palard [Mon, 26 Nov 2018 17:05:48 +0000 (18:05 +0100)] 
[3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722)

(cherry picked from commit 5719f275b7153a00a800f5481271a6fc26659c65)

Co-authored-by: Mathieu Dupuy <deronnax@users.noreply.github.com>
https://bugs.python.org/issue35255

6 years agobpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718)
Victor Stinner [Mon, 26 Nov 2018 13:17:01 +0000 (14:17 +0100)] 
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 59423e3ddd736387cef8f7632c71954c1859bed0)

6 years agobpo-35313: Fix test_embed when run from venv (GH-10713) (GH-10715)
Victor Stinner [Mon, 26 Nov 2018 11:42:06 +0000 (12:42 +0100)] 
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 a6537fb7c2f7a007b4ab616c4617afd56d18347d)

6 years agobpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708)
Miss Islington (bot) [Mon, 26 Nov 2018 01:00:37 +0000 (17:00 -0800)] 
bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708)

6 years agocloses bpo-35309: cpath should be capath (GH-10701)
Miss Islington (bot) [Sun, 25 Nov 2018 20:51:02 +0000 (12:51 -0800)] 
closes bpo-35309: cpath should be capath (GH-10701)

(cherry picked from commit 158695817d736df8b18682866033c87e46252309)

Co-authored-by: Boštjan Mejak <bostjan.xperia@gmail.com>
6 years agobpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592)
Miss Islington (bot) [Sun, 25 Nov 2018 09:30:37 +0000 (01:30 -0800)] 
bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592)

(cherry picked from commit 4bb186d7e253ad4def875305e06690181e923dfd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agobpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689)
Miss Islington (bot) [Fri, 23 Nov 2018 19:58:08 +0000 (11:58 -0800)] 
bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689)

(cherry picked from commit 5b83ef71d3060e1651d3680e805f13a1049c7d6d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
Miss Islington (bot) [Fri, 23 Nov 2018 17:41:54 +0000 (09:41 -0800)] 
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 1d817e4c8259f49602eefe9729743f6d9d748e8d)

Co-authored-by: Dustin Spicuzza <dustin@virtualroadside.com>
6 years agobpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675)
Miss Islington (bot) [Fri, 23 Nov 2018 17:13:32 +0000 (09:13 -0800)] 
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 9de363271519e0616f4a7b59427057c4810d3acc)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agoLinkify SMTP.quit() in smtplib documentation. (GH-9785)
Miss Islington (bot) [Fri, 23 Nov 2018 16:59:05 +0000 (08:59 -0800)] 
Linkify SMTP.quit() in smtplib documentation. (GH-9785)

(cherry picked from commit ba57963a95a994947b8bec6869e810a74a751278)

Co-authored-by: takey <taketakeyyy@gmail.com>
6 years ago[3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678)
Victor Stinner [Fri, 23 Nov 2018 16:53:14 +0000 (17:53 +0100)] 
[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 aac1f81eef971876ba5b1673db9ce6620311c469)

* 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 b409ffa848b280c1db1b4f450bfae14f263099ac)
Co-Authored-By: nierob <nierob@users.noreply.github.com>
6 years agobpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673)
Victor Stinner [Fri, 23 Nov 2018 12:37:42 +0000 (13:37 +0100)] 
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 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0)

6 years ago[3.7] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662)
Victor Stinner [Thu, 22 Nov 2018 16:15:37 +0000 (17:15 +0100)] 
[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 82af0b63b07aa8d92b50098e382b458143cfc677)

* 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 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b)

6 years agoRevert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660)
Victor Stinner [Thu, 22 Nov 2018 15:11:15 +0000 (16:11 +0100)] 
Revert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660)

This reverts commit d2be9a5c13221fb84c2221bbfd93efac6111e697.

6 years agobpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)
Miss Islington (bot) [Thu, 22 Nov 2018 14:17:34 +0000 (06:17 -0800)] 
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 9a0d7a7648547ffb77144bf2480155f6d7940dea)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH...
Miss Islington (bot) [Wed, 21 Nov 2018 22:46:30 +0000 (14:46 -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>
6 years ago[3.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023)
Miss Islington (bot) [Wed, 21 Nov 2018 12:54:17 +0000 (04:54 -0800)] 
[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 361e8683e7340c600b22f4a514b81448ccec66dc)

Co-authored-by: Zhiming Wang <github@zmwang.pw>
6 years agobpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH... 10632/head
Miss Islington (bot) [Wed, 21 Nov 2018 08:48:57 +0000 (00:48 -0800)] 
bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10629)

(cherry picked from commit d936a8f8e0964de1147656f1435532f0170f8b6c)

Co-authored-by: Julien Palard <julien@palard.fr>
6 years agobpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
Miss Islington (bot) [Tue, 20 Nov 2018 21:48:34 +0000 (13:48 -0800)] 
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)

(cherry picked from commit c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
6 years agobpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619)
Victor Stinner [Tue, 20 Nov 2018 21:06:21 +0000 (22:06 +0100)] 
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 02e6bf7f2025cddcbde6432f6b6396198ab313f4)

6 years agobpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)
Miss Islington (bot) [Tue, 20 Nov 2018 18:59:12 +0000 (10:59 -0800)] 
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 3ec0f495163da3b7a15deb2805cec48aed432f58)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agobpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330)
Miss Islington (bot) [Tue, 20 Nov 2018 18:07:54 +0000 (10:07 -0800)] 
bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330)

(cherry picked from commit 6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years agoUpgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)
Miss Islington (bot) [Mon, 19 Nov 2018 13:07:34 +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>
6 years agobpo-35233: test_embed: fix filesystem encoding (GH-10597)
Victor Stinner [Mon, 19 Nov 2018 09:05:55 +0000 (10:05 +0100)] 
bpo-35233: test_embed: fix filesystem encoding (GH-10597)

Fix InitConfigTests: if utf8_mode is enabled, the expected filesystem
encoding is UTF-8.

6 years agobpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585)
Miss Islington (bot) [Sun, 18 Nov 2018 16:58:20 +0000 (08:58 -0800)] 
bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585)

coro->cr_origin wasn't initialized if compute_cr_origin() failed in
PyCoro_New(), which would cause a crash during the coroutine's
deallocation.

https://bugs.python.org/issue35269
(cherry picked from commit 062a57bf4b768ef726975bcc1d34398387520147)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable ...
Steve Dower [Sun, 18 Nov 2018 04:42:08 +0000 (20:42 -0800)] 
bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861)

6 years ago[3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as ...
Miss Islington (bot) [Sat, 17 Nov 2018 19:49:58 +0000 (11:49 -0800)] 
[3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10586)

Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.cGH-L51

Source of PyUnicode_FromString
https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702

https://bugs.python.org/issue25438
(cherry picked from commit 689d555ec135d4115574addd063c358ac4897cc4)

Co-authored-by: Windson yang <wiwindson@outlook.com>
https://bugs.python.org/issue25438

6 years agoAdd --tempdir option for test run (GH-10322)
Miss Islington (bot) [Sat, 17 Nov 2018 12:31:47 +0000 (04:31 -0800)] 
Add --tempdir option for test run (GH-10322)

(cherry picked from commit 38df97a03c5102e717a110ab69bff8e5c9ebfd08)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
6 years agobpo-35202: Remove more unused imports in idlelib (GH-10573)
Miss Islington (bot) [Sat, 17 Nov 2018 06:48:40 +0000 (22:48 -0800)] 
bpo-35202: Remove more unused imports in idlelib (GH-10573)

(cherry picked from commit 5a087d5401e6956cf4c6d95f15fedabf39a4f5af)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
6 years agoAdd a missed PyErr_NoMemory() in symtable_new(). (GH-10576) 10581/head
Miss Islington (bot) [Fri, 16 Nov 2018 16:31:47 +0000 (08:31 -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>
6 years agobpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565)
Miss Islington (bot) [Fri, 16 Nov 2018 13:55:14 +0000 (05:55 -0800)] 
bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565)

(cherry picked from commit 4edeaeac4c194ba5d09187640b5cfca5e03be617)

Co-authored-by: Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) <thatiparthysreenivas@gmail.com>
6 years agoFix outdated info in datamodel about dicts (GH-9807)
Miss Islington (bot) [Fri, 16 Nov 2018 12:20:03 +0000 (04:20 -0800)] 
Fix outdated info in datamodel about dicts (GH-9807)

(cherry picked from commit a48e0eb9673ec96d1decb8a230331533cfb6138b)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
6 years agobpo-33816: Remove outdated metaclass example (GH-7566)
Miss Islington (bot) [Fri, 16 Nov 2018 11:51:20 +0000 (03:51 -0800)] 
bpo-33816: Remove outdated metaclass example (GH-7566)

(cherry picked from commit c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
6 years agobpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)
Miss Islington (bot) [Fri, 16 Nov 2018 11:34:35 +0000 (03:34 -0800)] 
bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)

* The _PySys_EndInit() function now copies the
  config->module_search_path list, so config is longer modified when
  sys.path is updated.
* config->warnoptions list and config->xoptions dict are also copied
* test_embed: InitConfigTests now also tests
  main_config['module_search_path']
* Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions
   but sys.warnoptions to decide if the warnings module should
   be imported at startup.
(cherry picked from commit 37cd982df02795905886ab36a2378ed557cb6f60)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
6 years agobpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478)
Miss Islington (bot) [Thu, 15 Nov 2018 19:31:31 +0000 (11:31 -0800)] 
bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478)

(cherry picked from commit b65413b497a07f521d835b799be7dd0afcedbd65)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
6 years agoFix a possible reference leak in _socket.getaddrinfo(). (GH-10543)
Miss Islington (bot) [Thu, 15 Nov 2018 09:25:34 +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>
6 years agoFix typo in asynchronous generator iterator documentation (GH-10542)
Miss Islington (bot) [Thu, 15 Nov 2018 06:20:16 +0000 (22:20 -0800)] 
Fix typo in asynchronous generator iterator documentation (GH-10542)

Remove an unnecessary "that":
... will execute that the body ... ->  ... will execute the body ...
(cherry picked from commit 25221b328339fb1726b58742e91b6e49c178023a)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
7 years agobpo-35233: InitConfigTests tests more config vars (GH-10541) (GH-10546)
Victor Stinner [Wed, 14 Nov 2018 17:58:01 +0000 (18:58 +0100)] 
bpo-35233: InitConfigTests tests more config vars (GH-10541) (GH-10546)

test_embed.InitConfigTests tests more configuration variables.

Changes:

* InitConfigTests tests more core configuration variables:

  * base_exec_prefix
  * base_prefix
  * exec_prefix
  * home
  * module_search_path_env
  * prefix

* "_testembed init_from_config" tests more variables:

  * argv
  * warnoptions
  * xoptions

* Py_HasFileSystemDefaultEncoding value is no longer tested since it
  depends on the LC_CTYPE locale and the platform.
* InitConfigTests: add check_global_config(), check_core_config() and
  check_main_config() subfunctions to cleanup the code. Move also
  constants at the class level (ex: COPY_MAIN_CONFIG).
* Use more macros in _PyCoreConfig_AsDict() and
  _PyMainInterpreterConfig_AsDict() to reduce code duplication.
* Other minor cleanups.

(cherry picked from commit 01de89cb59107d4f889aa503a1c0350dae4aebaf)

7 years ago[3.7] bpo-32613: Update window FAQ (GH-5552). (GH-10544)
Julien Palard [Wed, 14 Nov 2018 17:17:35 +0000 (18:17 +0100)] 
[3.7] bpo-32613: Update window FAQ (GH-5552). (GH-10544)

(cherry picked from commit 64313478bcbd0a708c3ce5d4d14f977da56e4be9)

Co-authored-by: Julien Palard <julien@palard.fr>
https://bugs.python.org/issue32613

7 years agobpo-35233: Fix test_embed.InitConfigTests on macOS (GH-10539)
Victor Stinner [Wed, 14 Nov 2018 10:36:47 +0000 (11:36 +0100)] 
bpo-35233: Fix test_embed.InitConfigTests on macOS (GH-10539)

On macOS and Windows, Py_HasFileSystemDefaultEncoding is 1 by
default.

7 years agobpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10537)
Victor Stinner [Wed, 14 Nov 2018 01:45:25 +0000 (02:45 +0100)] 
bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10537)

Fix _PyMainInterpreterConfig_Copy(): copy 'install_signal_handlers'
attribute

7 years ago[3.7] bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524) (GH-10529)
Victor Stinner [Wed, 14 Nov 2018 01:01:52 +0000 (02:01 +0100)] 
[3.7] bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524) (GH-10529)

* Add C functions:

  * _Py_GetGlobalVariablesAsDict()
  * _PyCoreConfig_AsDict()
  * _PyMainInterpreterConfig_AsDict()

* Add new _testcapi methods:

  * get_global_config()
  * get_core_config()
  * get_main_config()

* test.pythoninfo: get global, core and main configuration
* _testembed now serializes global, core and main configurations
  using JSON to reuse _Py_GetGlobalVariablesAsDict(),
  _PyCoreConfig_AsDict() and _PyMainInterpreterConfig_AsDict(),
  rather than duplicating code.
* test_embed.InitConfigTests now test much more configuration
  variables

7 years agoGrammar corrections in abc.rst (GH-10525)
Miss Islington (bot) [Wed, 14 Nov 2018 01:00:36 +0000 (17:00 -0800)] 
Grammar corrections in abc.rst (GH-10525)

(cherry picked from commit 8e0b05e2f4b9fd703cbe1ae8d058852ef3781f44)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agoLink to property built-in in abc.rst (GH-10526)
Miss Islington (bot) [Wed, 14 Nov 2018 00:45:11 +0000 (16:45 -0800)] 
Link to property built-in in abc.rst (GH-10526)

(cherry picked from commit bf1355b4240173a306dd46e720ae4b696277bb41)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years ago[3.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10522)
Miss Islington (bot) [Wed, 14 Nov 2018 00:39:36 +0000 (16:39 -0800)] 
[3.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10522)

Discovered using clang's MemorySanitizer when it ran python3's
test_fstring test_misformed_unicode_character_name.

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

Co-authored-by: Gregory P. Smith <greg@krypto.org>
https://bugs.python.org/issue35214

7 years agoFix doc typo: Window -> Windows (GH-10508)
Miss Islington (bot) [Wed, 14 Nov 2018 00:18:20 +0000 (16:18 -0800)] 
Fix doc typo: Window -> Windows (GH-10508)

(cherry picked from commit daeb3c4c58663c2e2a3ddf1c2fbbff9a06269961)

Co-authored-by: l-n-s <supervillain@riseup.net>
7 years agobpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) (GH-10517)
Victor Stinner [Tue, 13 Nov 2018 14:50:56 +0000 (15:50 +0100)] 
bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) (GH-10517)

If tracemalloc is not tracing Python memory allocations,
_PyMem_DumpTraceback() now suggests to enable tracemalloc
to get the traceback where the memory block has been allocated.