Commit Graph

21082 Commits

Author SHA1 Message Date
Miss Islington (bot) 7638eb892a bpo-34126: Fix crashes while profiling invalid calls. (GH-8300) (GH-8371)
(cherry picked from commit 56868f940e)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-07-21 19:58:35 +03:00
Miss Islington (bot) 03ec4df67d bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043) (GH-8352)
Py_Main() can again be called after Py_Initialize(), as in Python
3.6. The new configuration is ignored, except of
_PyMainInterpreterConfig.argv which is used to update sys.argv.
(cherry picked from commit fb47bca9ee)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-21 02:16:22 +02:00
Miss Islington (bot) 6020d98bea
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an exception set (GH-8282)
(cherry picked from commit 28f07364f0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-17 00:09:32 -07:00
Miss Islington (bot) 5594f1dfbe
bpo-24618: Add a check in the code constructor. (GH-8283)
Check that the size of the varnames tuple is enough at least for all arguments.
(cherry picked from commit bd47384e07)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-16 00:09:44 -07:00
Miss Islington (bot) 3fc12f0e2a
bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288)
(cherry picked from commit 15c7b2abdf)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-07-15 17:44:11 -07:00
Miss Islington (bot) c721472fb8
bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)
`_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char.
It caused buffer overflow in `_Py_string_to_number_with_underscores()`.

This bug is introduced in 9b6c60cb.
(cherry picked from commit 16dfca4d82)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-07-13 20:58:12 -07:00
Miss Islington (bot) cf21d0031d bpo-34108: Fix double carriage return in 2to3 on Windows (GH-8271) (#8275)
* Add test capturing failure.
* Honor newlines as present in the original file.
(cherry picked from commit cafaf0447b)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2018-07-13 15:24:19 -04:00
Miss Islington (bot) 9beed0c36f
bpo-34080: Fix a memory leak in the compiler. (GH-8222)
(cherry picked from commit 993030aac5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-11 14:54:29 -07:00
Miss Islington (bot) 48d2aeb009
bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)
(cherry picked from commit 504373c59b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-11 09:56:05 -07:00
Miss Islington (bot) 020f5ab717
bpo-33648: Remove PY_WARN_ON_C_LOCALE (GH-7114)
This code does not appear to be used anywhere in the python code base.
The use was removed in eb81795d7d.
(cherry picked from commit b91a3a0d61)

Co-authored-by: Eitan Adler <grimreaper@users.noreply.github.com>
2018-07-11 07:48:42 -07:00
Miss Islington (bot) df9f633f94
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
(cherry picked from commit 445f1b35ce)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-10 00:48:57 -07:00
Miss Islington (bot) 22fb674fa4
bpo-24459: Document missing env variables in python.man (GH-4142)
Initial patch by Joshua Jay Herman.
(cherry picked from commit 9863de0355)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-09 12:37:23 -07:00
Miss Islington (bot) f5197ddfd0
bpo-34066: Disabled interruption before SETUP_WITH and BEFORE_ASYNC_WITH. (GH-8159)
This will prevent emitting a resource warning when the execution was
interrupted by Ctrl-C between calling open() and entering a 'with' block
in "with open()".
(cherry picked from commit 3f4d90d4d7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-09 06:31:03 -07:00
Serhiy Storchaka 7c43b80150
[3.7] bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684). (GH-8193)
(cherry picked from commit 2a9b8babf0)
2018-07-09 12:55:35 +03:00
Miss Islington (bot) a410f9f614
bpo-31014: Fix the webbrowser module. (GH-7267)
webbrowser._synthesize() called webbrowser.register() with
outdated signature.

Co-Authored-By: John Still <john@jmsdvl.com>
(cherry picked from commit 25b804a9c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-08 01:09:21 -07:00
Miss Islington (bot) a912305512
closes bpo-34050: Fix link in SSL docs (GH-8173)
(cherry picked from commit 9c5ba09748)

Co-authored-by: Marcin Niemira <marcin@niemira.net>
2018-07-07 15:47:35 -07:00
Dong-hee Na 75f2eb5eca [3.7] bpo-34065: Improve the markup of logging.basicConfig() arguments (GH-8153). (GH-8156)
(cherry picked from commit 2800dcf656)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-07 19:12:11 +03:00
Miss Islington (bot) 7bd6f0e550
closes bpo-34056: Always return bytes from _HackedGetData.get_data(). (GH-8130)
* Always return bytes from _HackedGetData.get_data().

Ensure the imp.load_source shim always returns bytes by reopening the file in
binary mode if needed. Hash-based pycs have to receive the source code in bytes.

It's tempting to change imp.get_suffixes() to always return 'rb' as a mode, but
that breaks some stdlib tests and likely 3rdparty code, too.
(cherry picked from commit b0274f2cdd)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-07-06 21:00:45 -07:00
Miss Islington (bot) 127bd9bfd5
bpo-34042: Fix dict.copy() to maintain correct total refcount (GH-8119)
(cherry picked from commit 0b75228700)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-07-06 09:40:17 -07:00
Miss Islington (bot) 4bd5fce27d
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
The multiprocessing module now uses the monotonic clock
time.monotonic() instead of the system clock time.time() to implement
timeouts.
(cherry picked from commit c2368cbc83)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-06 05:11:21 -07:00
Ammar Askar ab75d9e424 [3.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior (GH-7891) (GH-8132)
Most of the change involves fixing up the test suite, which previously made
the assumption that there wouldn't be a new line if the input didn't end in
one.

Contributed by Ammar Askar.

(cherry picked from commit c4ef4896ea)
2018-07-06 13:21:05 +03:00
Victor Stinner 29be3bd3c9
bpo-34044: subprocess.Popen copies startupinfo (GH-8090) (GH-8121)
subprocess.Popen now copies the startupinfo argument to leave it
unchanged: it will modify the copy, so that the same STARTUPINFO
object can be used multiple times.

Add subprocess.STARTUPINFO._copy() private method.

Python 3.7 backport from master makes the copy() private: renamed to
_copy().

(cherry picked from commit 483422f57e)
2018-07-05 23:15:28 +02:00
Miss Islington (bot) c1b75b5fb9
bpo-34010: Fix tarfile read performance regression (GH-8020)
During buffered read, use a list followed by join instead of extending a bytes object.
This is how it was done before but changed in commit b506dc32c1.
(cherry picked from commit 12a08c4760)

Co-authored-by: hajoscher <hajoscher@gmail.com>
2018-07-04 01:32:41 -07:00
Miss Islington (bot) 20ae4c6025 bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918) (GH-8070)
PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-03 22:13:28 +02:00
Miss Islington (bot) cee7b2261f
bpo-34019: Fix wrong arguments for Opera Browser (GH-8047)
The Opera Browser was using a outdated command line invocation that resulted in an incorrect URL being opened in the browser when requested using the webbrowser module.

* Correct the arguments passed to the Opera Browser when opening a new URL.
(cherry picked from commit 3cf1f154ed)

Co-authored-by: Bumsik Kim <k.bumsik@gmail.com>
2018-07-03 05:17:28 -07:00
Miss Islington (bot) 4d02ad856f
bpo-34006: Revert line length limit for Windows help docs (GH-8051)
The line-length limit is not needed because the pages appear in a separate app rather
 than on a browser tab.  It can also interact badly with the DPI setting.
(cherry picked from commit d824ca7f4d)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2018-07-02 15:23:22 -07:00
Miss Islington (bot) 6f49afc3d9 bpo-33978: Close existing handlers before logging (re-)configuration. (GH-8008) (GH-8044)
(cherry picked from commit 087570af6d)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-07-02 10:35:09 +01:00
Miss Islington (bot) fd1c092bb9 bpo-32568: make select.epoll() and its docs consistent (GH-7840) (GH-8024)
* `flags` is indeed deprecated, but there is a validation on its value for
  backwards compatibility reasons.  This adds mention of this in the docs.
* The docs say that `sizehint` is deprecated and ignored, but it is still
  used when `epoll_create1()` is unavailable. This adds mention of this in
  the docs.
* `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`.
  This is needed to have a default value available at the Python level,
  since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938)
* Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`.

The relevant tests have also been updated.

(cherry picked from commit 0cdf5f4289)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-30 16:03:19 +03:00
Miss Islington (bot) 42ea522664
bpo-33974: Fix passing special characters to ttk widgets. (GH-7986)
Fix passing lists and tuples of strings containing special characters
'"', '\\', '{', '}' and '\n' as options to tkinter.ttk widgets.
(cherry picked from commit 5bb5bbfca8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-29 23:42:57 -07:00
Miss Islington (bot) eabebbb54c
bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)
(cherry picked from commit 23db935bcf)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-29 03:34:34 -07:00
Miss Islington (bot) e2c5a753fa
bpo-14117: Make minor tweaks to turtledemo (GH-8002)
The 'wikipedia' example is now 'rosette', describing what it draws.
The 'penrose' print output is reduced.  The 'tree' '1024'
output is eliminated.
(cherry picked from commit 891a1f86d4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-28 22:30:44 -07:00
Miss Islington (bot) 3ed4414121
bpo-27500: Fix static version of getaddrinfo to resolve IPv6 (GH-7993)
(cherry picked from commit d904c238ca)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-28 19:16:48 -07:00
Miss Islington (bot) 9d92524c11 bpo-31546: Fix input hook integration (GH-7978)
(cherry picked from commit 9b9d58f0d8)

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
2018-06-28 10:48:37 -07:00
Miss Islington (bot) 4c20d2bf5d
bpo-33985: Implement ContextVar.name attribute. (GH-7980)
(cherry picked from commit 41cb0baea9)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-28 10:39:54 -07:00
Ned Deily 0c5918f6f4 Fix NEWS entry for bpo-31647 2018-06-28 04:03:32 -04:00
Ned Deily 933c4513c6 Python 3.7.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlszAEkACgkQLTR+pqpl
 Qh3umg//a3eSst508H59PVuPoiQv4JeX4lvV2WMy//51qk47tlgdJp8OXcYM6Y11
 uCrQSTFVJaRu+/gBiPgT4yiXdCh/DsphLhqsgm1vSlzego+J+hkdREelUeWKhX/X
 Pyu2GbOwxtyOfaWjyRNEtT2/8XdCBjo4dw68p2JvlQ65X/duCHM3dp4PIL2u5CHH
 5/DeBrqLBWyYUwumyWFx4z5PrTN1EmO8yR6B9F0u518k1pgTqd7flRefHwyd2jzA
 S9F7JgUgyTiwO3FmjylIem9uLgOyWuldH+czsAqyEmodo7jb4ekxv+jVMiLStt2r
 Ct/yxx+rPNjhtJZtiWUd6gl6Z5Z9tLx7qc13RoryijFhiUD/G8gFx28wVMExzW05
 fkNKNHNhM0iN4L1FCZuyLxFri8BX9gdpmY6XEuKffzhiGjcwnf0kMn5p5pmWrQbX
 vXnvtOabXqr71jNDy4SbzI+CsTQcTSQYkVAZiPOwBjjt/cKhyUO6B5NHA8A3MYxK
 Uevqr6rUC2x7rrTCh9lroJ7Npg8q3R1e6rd57MVumQlnyl8LQR5jpNuwcQjcV7Go
 IsIZ3VYVUYRJh1a2dTI3Cu6Z3RbFVbLChWGVTQ3kxd9pZ8oRx8Ts49BteUxo5VcY
 XQnMxIOifWAFkc5Y/yT5IiS+IXtQm8xqkpwsg6kfP5dI8/dxMQo=
 =jOsP
 -----END PGP SIGNATURE-----

Merge 3.7.0 final changes
2018-06-27 18:23:18 -04:00
Victor Stinner 7b5856e7f0
Revert "bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)" (GH-7963)
This reverts commit 8b1ebcd7cb.
2018-06-27 15:17:34 +02:00
Miss Islington (bot) 8b1ebcd7cb
bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)
Fix a race condition in Popen of
multiprocessing.popen_spawn_win32. The child process now duplicates
the read end of pipe instead of "stealing" it.

Previously, the read end of pipe was "stolen" by the child process,
but it leaked a handle if the child process had been terminated
before it could steal the handle from the parent process.
(cherry picked from commit 2cc9d21fff)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 02:59:44 -07:00
Miss Islington (bot) 0eaf7b975b bpo-24567: Random subnormal.diff (GH-7954) (GH-7955)
Handle subnormal weights for choices()
(cherry picked from commit ddf7171911)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-06-27 01:53:04 -07:00
Miss Islington (bot) ca97b64a65
bpo-33975: Avoid small type when running IDLE's htests. (GH-7944)
Import pyshell first in htest to call SetProcessDpiAwareness on Windows
before tkinter.Tk() is called for the htest. Apparently, 'root.destroy()'
undoes a previous 'root = Tk()'. Since IDLE unittests always destroy roots,
a unittest before an htest does not require anything more to work right.
Since part of the purpose of human-viewed tests is to determine that
widgets look right, it is important that they look the same for testing
as when running IDLE.
(cherry picked from commit 3c8043d8fa)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-26 21:37:51 -07:00
Ned Deily 1bf9cc5093 3.7.0 final 2018-06-26 23:07:35 -04:00
Miss Islington (bot) fb17b81fc9
bpo-33956: update vendored expat to 2.2.5 (GH-7925)
(cherry picked from commit 4e21100fa7)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-06-26 19:44:32 -07:00
Miss Islington (bot) b940921a67 bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845)
Calling Py_Initialize() twice does nothing, instead of failing with a
fatal error: restore the Python 3.6 behaviour.
(cherry picked from commit 209abf7469)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-26 20:14:34 -04:00
Miss Islington (bot) 235d0fb93c bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring. (GH-7682)
(cherry picked from commit 08f127a3ca)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-26 19:53:27 -04:00
Victor Stinner d1f9481b7a
bpo-33873: Backport regrtest from master to 3.7 (GH-7935)
* bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)

* Enhance also format_duration(): work on integers and rounds towards
  +infinity (math.ceil).
* Write unit tests on format_duration()

(cherry picked from commit 4ffe9c2b25)

* bpo-33873: regrtest: Add warning on -R 1:3 (GH-7736)

regrtest: Add warning when using less than 3 warmup runs like -R 1:3.
(cherry picked from commit cac4fef886)

* bpo-33873: Fix bug in `runtest.py` and add checks for invalid `-R` parameters (GH-7735)

Fix bug in `Lib/test/libregrtest/runtest.py` that makes running tests an extra time than the specified number of runs.

Add check for invalid --huntrleaks/-R parameters.

(cherry picked from commit 58ed7307ea)
2018-06-26 23:47:35 +02:00
Miss Islington (bot) 56aaef0ddb
bpo-33451: Close pyc files before calling PyEval_EvalCode() (GH-7884)
Directly executed pyc files were being kept open longer than necessary.
(cherry picked from commit ea737751b1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-23 20:31:21 -07:00
Miss Islington (bot) bbef7abe92
bpo-33805: Improve error message of dataclasses.replace() (GH-7580)
(cherry picked from commit 3d70f7aef6)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-06-23 08:04:01 -07:00
Miss Islington (bot) efc6bf66a5
bpo-33916: Fix bz2 and lzma init when called twice (GH-7843)
bz2, lzma: When Decompressor.__init__() is called twice, free the old
lock to not leak memory.
(cherry picked from commit 9b7cf75721)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-23 01:53:03 -07:00
Miss Islington (bot) 3747dd16d5
bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845)
Calling Py_Initialize() twice does nothing, instead of failing with a
fatal error: restore the Python 3.6 behaviour.
(cherry picked from commit 209abf7469)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-22 10:33:48 -07:00
Miss Islington (bot) 1bb9dd337e bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7824)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
(cherry picked from commit 06fe77a84b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-22 09:10:20 +02:00