Commit Graph

21427 Commits

Author SHA1 Message Date
Miss Islington (bot) cb272843f2
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
(cherry picked from commit 842acaab13)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-17 07:10:20 -08:00
Miss Islington (bot) 9ade4cbc0f
bpo-35513, unittest: TextTestRunner uses time.perf_counter() (GH-11180)
TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test: time.time()
can go backwards, whereas time.perf_counter() is monotonic.

Similar change made in libregrtest, pprint and random.
(cherry picked from commit 8db5b54463)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-17 02:49:22 -08:00
Miss Islington (bot) be69ff232d
bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)
Replace time.time() with time.monotonic() in tests to measure time
delta.

test_zipfile64: display progress every minute (60 secs) rather than
every 5 minutes (5*60 seconds).
(cherry picked from commit 2cf4c202ff)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-17 01:03:04 -08:00
Miss Islington (bot) 2d91a1325f bpo-35412: Add testcase to test_future4 (GH-11131) (GH-11183)
Add testcase to test_future4: check unicode literal.
(cherry picked from commit 502fe19b10)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-17 09:34:06 +01:00
Miss Islington (bot) 9a4758550d bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164) (GH-11179)
"make profile-opt" no longer replaces CFLAGS_NODIST with CFLAGS. It
now adds profile-guided optimization (PGO) flags to CFLAGS_NODIST,
existing CFLAGS_NODIST flags are kept.
(cherry picked from commit 640ed520dd)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-16 23:24:04 +01:00
Miss Islington (bot) 77824ef6e5 bpo-35402: Update Windows build to use Tcl and Tk 8.6.9 (GH-11146)
(cherry picked from commit f8e9bd568a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-12-14 09:49:10 -08:00
Miss Islington (bot) 5f252e1ebc
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-14 04:26:58 -08:00
Serhiy Storchaka 922b2a0d0d
[3.7] bpo-31446: Copy command line that should be passed to CreateProcessW(). (GH-11141). (GH-11149)
(cherry picked from commit 7b36016a15)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-12-14 11:18:13 +02:00
Miss Islington (bot) f27f0d2be4 Add test for double patching instance methods (GH11126)
(cherry picked from commit 5a718e918d)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2018-12-12 09:00:44 +00:00
Miss Islington (bot) 6a12931c9c bpo-17185: Add __signature__ to mock that can be used by inspect for signature (GH11125)
* Fix partial and partial method signatures in mock

* Add more calls

* Add NEWS entry

* Use assertEquals and fix markup in NEWS

* Refactor branching and add markup reference for functools

* Revert partial object related changes and fix pr comments
(cherry picked from commit f7fa62ef44)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-12-12 08:58:36 +00:00
Ned Deily 75a402a217 3.7.2rc1 2018-12-11 16:46:13 -05:00
Ned Deily 9383969788 Minor edits to NEWS entries 2018-12-11 16:28:00 -05:00
Serhiy Storchaka 3cae16d2e9
bpo-35444: Fix error handling when fail to look up builtin "getattr". (GH-11047) (GH-11107)
(cherry picked from commit bb86bf4c4e)
2018-12-11 10:51:27 +02:00
Miss Islington (bot) 3b9a0186c4
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:28:49 -08:00
Miss Islington (bot) c37923ece7
bpo-35401: Update macOS installer to OpenSSL 1.1.0j (GH-11094)
https://bugs.python.org/issue35401
(cherry picked from commit 3ec982640f)

Co-authored-by: Ned Deily <nad@python.org>
2018-12-10 21:43:17 -08:00
Miss Islington (bot) d1fb21209b
bpo-35401: Update Windows build to OpenSSL 1.1.0j (GH-11088)
(cherry picked from commit 4824385fec)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-12-10 20:16:46 -08:00
Steve Dower 0e4ad88ff8
bpo-34977: Add Windows App Store package (GH-11027)
Also adds the PC/layout script for generating layouts on Windows.
2018-12-10 19:58:52 -08:00
Steve Dower b264c60985
[3.7] bpo-34977: Use venv redirector instead of original python.exe on Windows (GH-11029) 2018-12-10 08:11:34 -08:00
Victor Stinner 1a7b62d557
bpo-35050: AF_ALG length check off-by-one error (GH-10058) (GH-11069)
The length check for AF_ALG salg_name and salg_type had a off-by-one
error. The code assumed that both values are not necessarily NULL
terminated. However the Kernel code for alg_bind() ensures that the last
byte of both strings are NULL terminated.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 2eb6ad8578)
2018-12-10 12:13:01 +01:00
Victor Stinner c3cc75134d
bpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061) (GH-11066)
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:48 +01:00
Miss Islington (bot) d4bcf13e06
bpo-33725: skip test_multiprocessing_fork on macOS (GH-11043)
(cherry picked from commit ac218bc5db)

Co-authored-by: Ned Deily <nad@python.org>
2018-12-08 23:06:53 -08:00
Miss Islington (bot) ee2c5a8e2d bpo-35330: Don't call the wrapped object if `side_effect` is set (GH11035)
* tests: Further validate `wraps` functionality in `unittest.mock.Mock`

Add more tests to validate how `wraps` interacts with other features of
mocks.

* Don't call the wrapped object if `side_effect` is set

When a object is wrapped using `Mock(wraps=...)`, if an user sets a
`side_effect` in one of their methods, return the value of `side_effect`
and don't call the original object.

* Refactor what to be called on `mock_call`

When a `Mock` is called, it should return looking up in the following
order: `side_effect`, `return_value`, `wraps`. If any of the first two
return `mock.DEFAULT`, lookup in the next option.

It makes no sense to check for `wraps` returning default, as it is
supposed to be the original implementation and there is nothing to
fallback to.
(cherry picked from commit f05df0a4b6)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-12-08 11:47:01 +00:00
Victor Stinner 783b794a5e
Revert "[3.7] bpo-34977: Add Windows App Store package (GH-10245)" (GH-11021)
This reverts commit 2532091493.
2018-12-07 14:31:40 +01:00
Serhiy Storchaka 0d5730e643
[3.7] bpo-22005: Fixed unpickling instances of datetime classes pickled by Python 2. (GH-11017) (GH-11022)
encoding='latin1' should be used for successful decoding.
(cherry picked from commit 8452ca15f4)
2018-12-07 14:56:02 +02:00
Zackery Spytz 602d307ac5 bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7)
2018-12-07 14:17:43 +02:00
Miss Islington (bot) 2db190bb35
bpo-34864: warn if "Prefer tabs when opening documents" set to "Always" (GH-10464)
* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe8794f0)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-12-06 22:51:10 -08:00
Steve Dower 2532091493
[3.7] bpo-34977: Add Windows App Store package (GH-10245) 2018-12-06 21:09:53 -08:00
Victor Stinner 3c6b0d967e
[3.7] Revert "bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9676)" (#10968)
This reverts commit 97f998a4df.
2018-12-06 01:49:05 +01:00
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) 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
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) 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) 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) 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
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 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
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
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
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) 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
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) 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
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
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
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
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
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) 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) c743a6ac36 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:34 -05:00
Miss Islington (bot) ae02a929dd
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 062a57bf4b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-18 08:58:20 -08:00
Steve Dower e851049e0e
bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861) 2018-11-17 20:42:08 -08:00
Miss Islington (bot) 579c417564
bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478)
(cherry picked from commit b65413b497)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-15 11:31:31 -08:00
Julien Palard 9053d2f2e0 [3.7] bpo-32613: Update window FAQ (GH-5552). (GH-10544)
(cherry picked from commit 64313478bc)

Co-authored-by: Julien Palard <julien@palard.fr>



https://bugs.python.org/issue32613
2018-11-14 09:17:35 -08:00
Miss Islington (bot) 9fbcb1402e
[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 746b2d35ea)


Co-authored-by: Gregory P. Smith <greg@krypto.org>


https://bugs.python.org/issue35214
2018-11-13 16:39:36 -08:00
Gregory P. Smith 5f4d05d83f
[3.7] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10492)
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.

Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that.  This lets our build succeed under the memory sanitizer.  not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.

(cherry picked from commit 1584a00815)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
2018-11-12 13:48:24 -08:00
Miss Islington (bot) b91c27d89d
bpo-34864: Document two IDLE on MacOS issues. (GH-10456)
The System Preferences Dock "prefer tabs always" setting disables some
IDLE features.  Menus are a bit different than as described for Windows
and Linux.
(cherry picked from commit 50ff02b431)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-10 20:46:12 -08:00
Miss Islington (bot) 2847ccae46
bpo-35202: Remove unused imports in idlelib (GH-10438)
(cherry picked from commit 43a74abb3a)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-11-09 23:06:22 -08:00
Miss Islington (bot) f16ebcd460
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.

Do a bounds check within find_op so it can return before going past the end as a safety measure.

7db3c48833GH-diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.

This bug was shipped in all Python 3.6 and 3.7 releases.

The included unittest won't fail unless you do a clang msan build.
(cherry picked from commit 49fa4a9f1e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-11-08 18:13:14 -08:00
Miss Islington (bot) 9d3658147b
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
(cherry picked from commit a44d34e179)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-07 23:08:05 -08:00
Miss Islington (bot) 3ba5e253de
Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403)
This reverts commit c64583b6d3 due to multiple buildbot failures when building it.
(cherry picked from commit 6843ffe453)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-11-07 16:13:58 -08:00
Miss Islington (bot) 881e273c79 bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) (GH-10377)
Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.

We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
(cherry picked from commit c64583b6d3)

Co-authored-by: samstagern <30337691+samstagern@users.noreply.github.com>
2018-11-07 19:26:15 +00:00
Miss Islington (bot) 2b2a8c130c
bpo-33000: Document that IDLE's shell has no line limit. (GH-10373)
A program that runs indefinitely can overfill memory.
(cherry picked from commit 76cd0c30d6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-06 21:06:54 -08:00
Miss Islington (bot) 34fcee9ed8
bpo-23220: Explain how IDLE's Shell displays output (GH-10356)
Add a new subsection to the doc.
(cherry picked from commit 75d9d59ab3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-06 10:27:20 -08:00
Miss Islington (bot) a437c285fa
bpo-35099: Improve the doc about IDLE running user code. (GH-10350)
The section is renamed from "IDLE -- console differences".  It mostly
covers the implications of using custom sys.stdxxx objects.
(cherry picked from commit 5e79090324)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-05 18:35:18 -08:00
Miss Islington (bot) 96fb350bfd bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10325)
(cherry picked from commit 59668aa8b7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2018-11-04 16:40:02 -05:00
BNMetrics 08026b103e [3.7]bpo-29341: Backport b942707 3.7 (#10298)
Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted..
(cherry picked from commit b942707fc2)

Co-authored-by: BNMetrics <luna@bnmetrics.com>
2018-11-02 13:56:25 -04:00
Miss Islington (bot) 04c96669b1
closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289)
This could cause compile errors on macOS or other platforms.
(cherry picked from commit 318ab63c01)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-11-01 20:09:04 -07:00
Miss Islington (bot) 71b6c1af72
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-10-31 05:36:20 -07:00
Serhiy Storchaka b183750f99
[3.7] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231). (GH-10253)
(cherry picked from commit 3f819ca138)
2018-10-31 11:00:24 +02:00
Miss Islington (bot) 1a3f18e2c5
bpo-35097: Add IDLE doc subsection explaining editor windows. (GH-10206)
Topics include opening, title and status bar, .py* extension, and running.
(cherry picked from commit ea9c8bd443)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-28 18:51:33 -07:00
Miss Islington (bot) ff8d626f3a
Issue 35093: Document the IDLE document viewer in the IDLE doc. (GH-10195)
Add a paragraph in "Help and preferences", "Help sources" subsection.
(cherry picked from commit 18032632ab)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-28 13:39:38 -07:00
Miss Islington (bot) c516dc6e57
bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://bugs.python.org/issue35089
(cherry picked from commit c8a8d6b347)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2018-10-28 09:16:36 -07:00
Miss Islington (bot) 593af34e64
bpo-35088: Update idlelib.help.copy_string docstring (GH-10164)
We now use git and backporting instead of hg and forward merging.
(cherry picked from commit 2b555fc1f0)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-27 22:52:08 -07:00
Miss Islington (bot) 2d3b7a9963
bpo-35087: Update idlelib help files for the current doc build. (GH-10162)
There is only one trivial change to idle.rst. Nearly all the changes to help.html are the elimination of chapter and section numbers on headers due to changes in the build system. help.py no longer requires header numbering.
(cherry picked from commit db40cb50eb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-27 22:40:00 -07:00
Miss Islington (bot) e2cf819539
bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095)
(cherry picked from commit 53125a53f4)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-10-27 14:06:20 -07:00
Miss Islington (bot) cb920c1442
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Specify that blocks are non-overlapping. Change '!=' to '<'.
(cherry picked from commit d9bff4e81b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-26 20:07:42 -07:00
Miss Islington (bot) 9080824513
bpo-35017, socketserver: don't accept request after shutdown (GH-9952)
Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
(cherry picked from commit 10cb3760e8)

Co-authored-by: Denis Ledoux <be.ledoux.denis@gmail.com>
2018-10-26 07:06:39 -07:00
Miss Islington (bot) ec10b70ea6
bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037)
(cherry picked from commit e483f02423)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-26 03:56:28 -07:00
Miss Islington (bot) c64c4056c1
bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098)
https://bugs.python.org/issue35038
(cherry picked from commit 1770d1c512)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-25 14:19:31 -07:00
Steve Dower a7ffb66395
[3.7] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) 2018-10-25 13:46:23 -04:00
Miss Islington (bot) 69a3f153a9
bpo-28015: Support LTO build with clang (GH-9908)
.o generated by clang in LTO mode actually are LLVM bitcode files, which
leads to a few errors during configure/build step:

- add lto flags to the BASECFLAGS instead of CFLAGS, as CFLAGS are used
  to build autoconf test case, and some are not compatible with clang LTO
  (they assume binary in the .o, not bitcode)
- force llvm-ar instead of ar, as ar is not aware of .o files generated
  by clang -flto
(cherry picked from commit 5ad36f9b21)

Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
2018-10-24 17:32:04 -07:00
Miss Islington (bot) f7cefb427c bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10069)
Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-23 23:46:32 +02:00
Miss Islington (bot) 7f34d55023
bpo-34973: Fix crash in bytes constructor. (GH-9841)
Constructing bytes from mutating list could cause a crash.
(cherry picked from commit 914f9a078f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-21 05:55:52 -07:00
Miss Islington (bot) 002aef3f66
closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961)
Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions
(cherry picked from commit 94451182cc)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-10-20 17:41:38 -07:00
Ned Deily f141ddaa30
[3.7] Remove duplicate NEWS entries due to cherry-picking (GH-10012) 2018-10-20 13:36:39 -04:00
Ned Deily 08eae4fa4c Python 3.7.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlvKxbwACgkQLTR+pqpl
 Qh1gIxAAs6/Ry7GirNwzVrKv6HG/GYFB61OaqmO2BMRRuFB226iQjdM1Amaw5I3m
 Dbe4rPrQWXPaI7UIMrbA/oK1BH5AZgpKcVr5YbXF3uAb3AN05E9iNGVbR+qQMlsd
 +3ydWrDcKzRJnVZxaUlLVZdEpaDXsAkAJTfOBNvwdfncBtPXa1+tbuT0SY6yGFwb
 NNq+BvYZJJKuWQ3s10zv5dnUiUlLJMLiVP0pZjwVS2d/gG2gs/rEzz2fBJKygjYR
 TTGhS69KGpqYOLq9USmUzI7DJNts7YeNhhiwF/X7qOx4y2n2dRz721SGlG+Nkxt6
 kvRv3LaLRKsBlPjoVHFyRwIlr4uc3JfwFL3ngswfUNgChrqxkEZgV4oouxeSVQ5o
 Yi/GGBA+c9xvdgufnaKgt8Ep30XRS7vfQZ8KeFwH2xWNCIglVHdBffwwlbwUWft5
 t3/udHDXdeUu7Yb7hfamaA5pafH5lwoQMlbSwOl9gg94sNNuERhocoi8IpMDhzDs
 cI7Jw8sAPWipn6F7k2rn8Z8RFWZEJr4XtgZs/+jTxS3DVfuV3EDYIlM2V/4SXK/b
 KCJ/4NqDjGEFyrSZ0/d5GnmE3dvWrYztUebotFvv2q2aPEv9u8n66BxH/pSLNFTJ
 CtITqOsRwU8IdeOIET0246Oi8Ha4ZU/qQdnPqv5bktD69qAxSOQ=
 =qLkl
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.1' into 3.7
2018-10-20 12:54:48 -04:00
Ned Deily 260ec2c36a 3.7.1final 2018-10-20 02:04:19 -04:00
Miss Islington (bot) dcd56f615e
bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051)
(cherry picked from commit a5259fb05d)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-10-19 22:54:09 -07:00
Miss Islington (bot) ce3b5a80cc bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850)
* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.
(cherry picked from commit bd036d3d15)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-10-20 00:38:56 -04:00
Miss Islington (bot) 60c663c0f7 bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849)
https://bugs.python.org/issue34970
(cherry picked from commit 97cf082872)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-10-20 00:37:51 -04:00
Ned Deily 03ca8b5f23 bpo-34909: NEWS entry. 2018-10-20 00:35:43 -04:00
Miss Islington (bot) 8f53dcdb24
bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784)
path_error() uses GetLastError() on Windows, but some os functions
are implemented via CRT APIs which report errors via errno.
This may result in raising OSError with invalid error code (such
as zero).

Introduce posix_path_error() function and use it where appropriate.
(cherry picked from commit 834603112e)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-10-19 17:46:25 -07:00
Miss Islington (bot) c8348fb6d2
bpo-33594: Add deprecation info in inspect.py module (GH-7036)
(cherry picked from commit ded87d804e)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-10-19 17:05:49 -07:00
Victor Stinner 0f2fc8bee0 bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978)
* raise exception if _missing_ returns None or invalid type
2018-10-19 16:49:30 -07:00
Miss Islington (bot) 4ec9f64e07 bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) (GH-9743)
On failure, _PyBytes_Resize() will deallocate the bytes object and set
"result" to NULL.

https://bugs.python.org/issue34824
(cherry picked from commit 365ad2ead5)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-20 01:14:42 +02:00
Miss Islington (bot) c119d5948f bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9545)
The xml.sax and xml.dom.domreg modules now obey
sys.flags.ignore_environment.

Signed-off-by: Christian Heimes <christian@python.org>

(cherry picked from commit 223e501fb9)

Co-authored-by: Christian Heimes <christian@python.org>
2018-10-20 01:09:01 +02:00
Miss Islington (bot) 6665802549 bpo-1621: Avoid signed integer overflow in set_table_resize() (GH-9059) (GH-9198)
Address a C undefined behavior signed integer overflow issue in set object table resizing.  Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-10-20 00:50:34 +02:00
Miss Islington (bot) b9182aa7da bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) (#9970)
The reprlib code was copied here instead of importing reprlib. I'm not sure if we really need to avoid the import, but since I expect dataclasses to be more common that reprlib, it seems wise. Plus, the code is small.
(cherry picked from commit dd13c88b53)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
2018-10-19 13:28:30 -04:00
Juliette Monsel bd9c2ce7ac bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957)
(cherry picked from commit 1deea5e539)
2018-10-19 18:20:00 +03:00
Miss Islington (bot) a66f279a13
bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660)
Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by
limiting the number of `MiniFieldStorage` objects created by `FieldStorage`.
(cherry picked from commit 209144831b)

Co-authored-by: matthewbelisle-wf <matthew.belisle@workiva.com>
2018-10-19 04:11:16 -07:00
Miss Islington (bot) 5b9b9353de
bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924)
C implementation of xml.etree.ElementTree.Element.__setstate__()
leaked references to children when called for already initialized
element.
(cherry picked from commit 6f906b3d72)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-18 00:17:15 -07:00
Miss Islington (bot) 178d1c0777
bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705)
On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
(cherry picked from commit 74a8b6ea7e)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-17 23:58:40 -07:00
Miss Islington (bot) 35ae99d7b3
[3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9940)
Restores the use of pyexpatns.h to isolate our embedded copy of the expat C
library so that its symbols do not conflict at link or dynamic loading time
with an embedding application or other extension modules with their own
version of libexpat.

5dc3f23b5fGH-diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat.
(cherry picked from commit 9d4712bc8f)


Co-authored-by: Gregory P. Smith <greg@krypto.org>


https://bugs.python.org/issue35011
2018-10-17 19:06:30 -07:00
Stéphane Wirtel 657e3f9a2c [3.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9926)
[3.7] [bpo-23420](https://bugs.python.org/issue23420): Verify the value of '-s' when execute the CLI of cProfile (GH-9925)

Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert
Kuska.

Co-authored-by: Robert Kuska <rkuska@gmail.com>
(cherry picked from commit fcd5e84a51)





https://bugs.python.org/issue23420
2018-10-17 04:48:05 -07:00
Miss Islington (bot) 514bbfc7fc
bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)
(cherry picked from commit e385d0661e)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-15 23:46:38 -07:00
Miss Islington (bot) fcea3ddc4a
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889)
python-gdb.py now handles errors on computing the line number
of a Python frame.

Changes:

* PyFrameObjectPtr.current_line_num() now catchs any Exception on
  calling addr2line(), instead of failing with a surprising "<class
  'TypeError'> 'FakeRepr' object is not subscriptable" error.
* All callers of current_line_num() now handle current_line_num()
  returning None.
* PyFrameObjectPtr.current_line() now also catchs IndexError on
  getting a line from the Python source file.
(cherry picked from commit 2e438cc255)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-10-15 14:47:56 -07:00
Miss Islington (bot) d991ede16b
bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850)
* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.
(cherry picked from commit bd036d3d15)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-10-15 14:20:11 -07:00
Cheryl Sabella b248a8c9a5 [3.7] bpo-11233: Create availability directive for documentation (GH-9692) (GH-9830)
Replace "Availability: xxx" with ".. availability:: xxx" in the doc.
 Original patch by Georg Brandl.

 Co-Authored-By: Georg Brandl <georg@python.org>
 (cherry picked from commit 2d6097d027)

 Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-10-15 22:52:26 +02:00
Miss Islington (bot) 1370832af2
bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852)
bytes and bytearray constructors converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e33)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-14 14:26:28 -07:00
Miss Islington (bot) b1c800303e
bpo-34941: Fix searching Element subclasses. (GH-9766)
Methods find(), findtext() and findall() of xml.etree.ElementTree.Element
were not able to find chldren which are instances of Element subclasses.
(cherry picked from commit b11c5667f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-14 00:55:49 -07:00
Ned Deily d04d3eaa6b Python 3.7.1rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlvBmH8ACgkQLTR+pqpl
 Qh2IJA//eIpaKR58zbWV1eTNaAE6doaZTFPm9nz2eGpniXmSsdenCqJZpFP6RT1G
 Su52FkCcapNwlBKifaZNU3tndYswG43/V1lB83km98PY/57j6OfCQhfOYE8POvJB
 Aj+cto2pLUErbHAOv7IfPadhD7DtNLUAye//xRbuichlCKNOUJ/DSUhETf3E3SMJ
 Tq1ukAWNZ6R+MWNm3jt6YMPU0BKO9knNxZp8GYRmxFgFy+/1pPF3AkrGch7UArns
 lyRIzFzfg8VU3O/zunpRqsOByPduJrnXl5iHj37nq2laTjVPzhP9ketpYaFzwH7f
 2NWWLBAiU2VwNkdVCN6o8fgk7jZmvdN/twMbihHV50K3AUihcsmF6pMzsSGSLTcX
 Hl5tA3bZMnbGfxZWMrKWX/vZFGdKUK5mkolMM/fCvvs1rsfN3us5bC2+yjD64Uh7
 EiDNCBANyYYsvPiRlFJgTXTuif/yJjJGwsJ9oUL/n6mRCyLYXAiqvYjVZukhdFAT
 8g1jaIt3ArIR17X0wL//saFNo/qtTO7y+IVnlsMg0VR5ctWn1I9N59szAubRkBF1
 Cr+pBQ6y8MYgMrLMxd1w3j946EOTxarNYt2YVPgGPjTZ250Fhs9bZ2hCl7rrleEW
 u5o+l/JeCefnW0ffIaFLszAsOW743GOZ4bSRgUzeAfA3BkiNASk=
 =gNS9
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.1rc2' into 3.7
2018-10-13 16:43:23 -04:00
Miss Islington (bot) 5dbb1b7df1 bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849)
https://bugs.python.org/issue34970
(cherry picked from commit 97cf082872)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-10-13 22:26:47 +03:00
Miss Islington (bot) 22381394ad
bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)
(cherry picked from commit d4d60134b2)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-13 02:48:18 -07:00
Ned Deily 6c06ef7dc3 3.7.1rc2 2018-10-13 03:01:13 -04:00
Ned Deily d8b6425e58 bpo-34370: Revert to using released Tk 8.6.8 with macOS installers
For 3.7.1rc1 and 3.6.7rc1 we used a pre-release development
snapshot of Tk 8.6 to pick up some post-8.6.8 fixes for macOS.
But the snapshot introduced at least one regression (bpo-34927).
For rc2, revert to using the standard release 8.6.8 for now.
This reverts commit d9cfe5ed2c.
2018-10-13 01:38:43 -04:00
Miss Islington (bot) 7a98e302c3 bpo-34900: Make TestCase.debug() work with subtests (GH-9707)
(cherry picked from commit da2bf9f66d)

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2018-10-12 14:07:01 +03:00
Serhiy Storchaka 8b040e5539
[3.7] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) (GH-9798)
for the SHAKE algorithm in the hashlib module.
(cherry picked from commit 9b8c2e7676)
2018-10-11 08:06:36 +03:00
Stéphane Wirtel a4910c2498 [3.7] bpo-34906: Doc: Fix typos (2) (GH-9735)
(cherry picked from commit 683281f536)
2018-10-10 15:39:17 +02:00
Miss Islington (bot) 41e5ec377b
bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716)
(cherry picked from commit c880ffe7d2)

Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
2018-10-09 09:03:35 -07:00
Miss Islington (bot) 0ce31d340b
bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656)
When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

Co-Authored-By: Marcel Plch <gmarcel.plch@gmail.com>

(cherry picked from commit 9b7c74ca32)
(cherry picked from commit 79d21331e6)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-10-09 08:21:17 -07:00
Miss Islington (bot) c4c86fad80
bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758)
Let .chm document display non-ASCII characters properly

Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems.
(cherry picked from commit 6261ae9b01)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2018-10-08 14:26:55 -07:00
Miss Islington (bot) 3b699932e5 bpo-6721: Hold logging locks across fork() (GH-4071) (#9291)
bpo-6721: When os.fork() was called while another thread holds a logging lock, the child process may deadlock when it tries to log.  This fixes that by acquiring all logging locks before fork and releasing them afterwards.

A regression test that fails before this change is included.

Within the new unittest itself: There is a small _potential_ due to mixing of fork and a thread in the child process if the parent's thread happened to hold a non-reentrant library call lock (malloc?) when the os.fork() happens.  buildbots and time will tell if this actually manifests itself in this test or not.  :/  A functionality test that avoids that would be a challenge.

An alternate test that isn't trying to produce the deadlock itself but just checking that the release and acquire calls are made would be the next best alternative if so.
(cherry picked from commit 19003841e9)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2018-10-07 00:09:59 -07:00
Miss Islington (bot) 1a2189353f bpo-34334: Don't log traceback twice in QueueHandler (GH-9537) (GH-9581)
(cherry picked from commit d345bb4d9b)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-10-07 00:33:37 -04:00
Miss Islington (bot) 49fb49d6f5
bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733)
(cherry picked from commit ae62f01524)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-06 00:07:12 -07:00
Miss Islington (bot) 476c294f26 bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (#9701)
https://bugs.python.org/issue34871
(cherry picked from commit 6f85b826b5)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-10-04 15:26:33 -04:00
Elvis Pranskevichus a67bd53d3f [3.7] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) (GH-9691)
The C implementation of asyncio.Task currently fails to perform the
cancellation cleanup correctly in the following scenario.

    async def task1():
        async def task2():
            await task3     # task3 is never cancelled

        asyncio.current_task().cancel()
        await asyncio.create_task(task2())

The actuall error is a hardcoded call to `future_cancel()` instead of
calling the `cancel()` method of a future-like object.

Thanks to Vladimir Matveev for noticing the code discrepancy and to
Yury Selivanov for coming up with a pathological scenario..
(cherry picked from commit 548ce9dedd)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>


https://bugs.python.org/issue34872
2018-10-03 08:49:00 -07:00
Miss Islington (bot) 063755c201
bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)
formatfloat() was not checking if PyBytes_FromStringAndSize()
failed, which could lead to a null pointer dereference in
_PyBytes_FormatEx().
(cherry picked from commit 96c5932794)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-02 23:33:42 -07:00
Miss Islington (bot) 97f998a4df bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9676)
Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
(cherry picked from commit 97bfe8d3eb)

Co-authored-by: tzickel <tzickel@users.noreply.github.com>
2018-10-02 23:17:04 +02:00
Miss Islington (bot) 0f161b3079
bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)
* Compiling a string annotation containing a lambda with keyword-only
argument without default value caused a crash.

* Remove the final "*" (it is incorrect syntax) in the representation of
lambda without *args and keyword-only arguments when compile from AST.

* Improve the representation of lambda without arguments.
(cherry picked from commit 2a2940e5c3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-30 11:19:15 -07:00
Miss Islington (bot) 2b01121fd4
bpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures (GH-9599)
Use a monotonic clock to compute timeouts in :meth:`Executor.map` and :func:`as_completed`, in order to prevent timeouts from deviating when the system clock is adjusted.

This may not be sufficient on all systems. On POSIX for example, the actual waiting (e.g. in ``sem_timedwait``) is specified to rely on the CLOCK_REALTIME clock.
(cherry picked from commit a94ee12c26)

Co-authored-by: orlnub123 <orlnub123@gmail.com>
2018-09-27 04:46:38 -07:00
Ned Deily dd7cf4564b Python 3.7.1rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlurJFsACgkQLTR+pqpl
 Qh19yhAAj9KbX8ESrnmCiLSWQOtNm0PnxuQNPPas0v4dN/5ntLJPdSCait4MZrQJ
 eZ1gpZd5ewuxH/Xsmyxs5zEAvSE0++w82TOsugsWMR3vCMsVnT9sU5iVL4fnRxge
 vOsgh/gWtaVOBQ+HJ2bjzM7LNbJc0NXtaRGswNwLRqW+dMN8oaJsrVo8IUROxJbt
 1CfJm2bg4BGPhpNjPNbiFgvoJp2YySRSHGDG7VSvfrP8AvUGykWkf4XYQfyG1Vq+
 rdUFM96gsjTDAYfDOTku8rpC3NF1clWiChfSJYIyEWginkirlNOXbOivjRnMIxd8
 wkVXFsSYBalUAGu83YP6JUUBG7IGaQlUQ8MbZa4GY76GlWTsOwD6jU+IVMjUODTO
 pXItEOe0CbmZBC4hCOZaDMlUUZ2KyAxkW53C9kOnVj1VoH5Nt2JRNi9cObpfzHm+
 tGT5PdybsyJ21mBSM2rISDcRNZre+8Nfa9IGE05P7yBqD/Y47xIP0leUbvGJxflB
 V0PlV5EHfhlD64BHTFccrX8GGk0XzxZh/HY3gOV5pVe51ea884ZSE+Tnlsuzvs+P
 23GYsPRCYJjcz4a3IAQV34oflCJhC7ra/ButAiAoW8zwXrH1HWi7mS0uD4CDURV4
 FP6ZSgNY/eEMmPLyExRuDc7dY8GgyYJK/TyHgWjI2guFx9OR8iM=
 =qgQm
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.1rc1' into 3.7
2018-09-26 20:04:22 -04:00
Ned Deily 2064bcf6ce 3.7.1rc1 2018-09-26 02:16:09 -04:00
Ned Deily d9cfe5ed2c bpo-34370: Update Tk 8.6 used with macOS installers
Have macOS 10.9+ installer builds for 3.7.1rc and 3.6.7rc use a development
snapshot of Tk 8.6 (post-8.6.8) to mitigate certain scroller issues seen
with IDLE and tkinter apps.
2018-09-26 01:06:13 -04:00
Miss Islington (bot) 12e3e80241
bpo-34320: Fix dict(o) didn't copy order of dict subclass (GH-8624)
When dict subclass overrides order (`__iter__()`, `keys()`, and `items()`), `dict(o)`
should use it instead of dict ordering.

https://bugs.python.org/issue34320
(cherry picked from commit 2aaf98c16a)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-09-25 21:17:52 -07:00
Miss Islington (bot) 3cc9557d9f
bpo-34790: [docs] Passing coroutines to asyncio.wait() can be confusing. (GH-9543)
(cherry picked from commit 996859a90d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-09-25 11:57:49 -07:00
Miss Islington (bot) 321f28c5f4
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
(cherry picked from commit 604e7b9931)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-09-25 05:38:45 -07:00
Miss Islington (bot) db23206367
bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)
The GlobalLock() call in UpdateDropDescription() was not checked for
failure.

https://bugs.python.org/issue34770
(cherry picked from commit f6c8007a29)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-09-24 21:44:11 -07:00
Christian Heimes 394e55a927 [3.7] bpo-17239: Disable external entities in SAX parser (GH-9217) (GH-9511)
The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue17239.
(cherry picked from commit 17b1d5d4e3)

Co-authored-by: Christian Heimes <christian@python.org>



https://bugs.python.org/issue17239
2018-09-24 05:38:37 -07:00
Victor Stinner ddc163df25
bpo-34783: Fix Py_Main() (GH-9526)
Fix a crash with musl libc (on Alpine Linux) when the script filename
specified on the command line doesn't exist. pymain_open_filename()
now gets the current core configuration from the interpreter state.

Modify the code to make it closer to the master branch:

* Rename _Py_CommandLineDetails to _PyCmdline
* Remove _PyMain.config: replaced with a local variable
  'local_config' in pymain_init()
* Reorganize pymain_main(): move code using the "local config"
  into pymain_init()
* As soon as possible, switch from the local config to the core
  configuration attached to the interpreter.
2018-09-24 05:03:01 -07:00