Commit Graph

102281 Commits

Author SHA1 Message Date
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) 8e23ba021f
bpo-23596: Add unit tests for the command line for the gzip module (GH-9775)
Add unit tests for the command line for the gzip module
(cherry picked from commit 84eec11995)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-09 14:42:58 -07: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) c59e75ccf0
bpo-34901: add isolated (-I) flag to sys.flags (GH-9708)
https://bugs.python.org/issue34901
(cherry picked from commit 656d52dbfd)

Co-authored-by: Danish Prakash <grafitykoncept@gmail.com>
2018-10-07 09:18:20 -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) 4322b8dd0f
Correct grammar mistake in re.rst. (GH-9745)
(cherry picked from commit 7dfbd49671)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-10-06 12:56:45 -07:00
Miss Islington (bot) 453b3b0e87 bpo-34909: keep searching mixins until base class is found (GH-9737) (GH-9738)
(cherry picked from commit cd45385ffa)
2018-10-06 00:43:20 -07: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) 0991b9bb94 [3.7] bpo-34158: Documentation UTC offset update (GH-8377) (GH-9732)
* Documentation of UTC offset update
Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update:

- "%z" format code documentation update
Karthikeyan Singaravelan commented on bugs.python.org:
Added as part of 018d353c1c and a fix regarding duplicate words for that part was added at bac2d5ba30.
Relevant format string at https://github.com/python/cpython/pull/2896/filesGH-diff-25e2d173c84057d069b7890450714eddR214.
Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/filesGH-diff-acc40bec51c7de832de3361db3edae52R309.
Table at https://docs.python.org/3.7/library/datetime.htmlGH-strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column
%z | UTC offset in the form ±HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030

- isoformat documentation update
According to me, needs confirmation:
Relevant format string at https://github.com/python/cpython/pull/4699/filesGH-diff-25e2d173c84057d069b7890450714eddR176
Relevant test case at https://github.com/python/cpython/pull/4699/filesGH-diff-25e2d173c84057d069b7890450714edd

* From Martin Panter: some style improvment;
From @pganssle: using f for fractional part of seconds in all file.
(cherry picked from commit 92878829c3)

Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>
2018-10-05 22:44:23 -04:00
Miss Islington (bot) 2fcaaaca52 [3.7] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) (GH-9681)
A follow up to be4e5b8920.
(cherry picked from commit e006b39a40)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-10-05 22:39:47 -04:00
Andrés Delfino b38ff71501 Fix markup for xml.sax in 3.7.rst (GH-9604) 2018-10-05 22:37:14 -04:00
Miss Islington (bot) 414d58f745 Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408)
The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

  aestack.push_async_exit(some_async_func)

or

  aestack.push_async_exit(some_async_func())

(It's the first one.)
(cherry picked from commit a3c88ef12c)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
2018-10-05 22:29:17 -04:00
Miss Islington (bot) 28dd737c46 bpo-34565: Change a PC/launcher.c comment to accurately describe valid major versions. (GH-9037) (GH-9065)
(cherry picked from commit 3876af4f7c)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
2018-10-05 22:18:41 -04:00
Miss Islington (bot) 1596fea0a3
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705)
The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0a67)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-05 14:28:56 -07:00
Serhiy Storchaka d9212200fe
[3.7] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726)
(cherry picked from commit addf8afb43)
2018-10-05 21:58:15 +03:00
Serhiy Storchaka 6bffe50f5f
Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725)
Fixes warnings in test added in bpo-34603.
(cherry picked from commit 4642d5f598)
2018-10-05 21:46:24 +03:00
Miss Islington (bot) b57f800b35
bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)
(cherry picked from commit 4313a293da)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-10-05 11:27:44 -07:00
Miss Islington (bot) 29c40c7314 bpo-34825: Add more entries to os to pathlib reference table (GH-9608) (#9717)
The added functions are as below :

| os module     | Pathlib       |
| ------------- | ------------- |
| os.chmod   | Path.chmod  |
| os.mkdir  | Path.mkdir  |
| os.rename | Path.rename |
| os.replace | Path.replace |
| os.rmdir  | Path.rmdir |
| os.remove, os.unlink | Path.unlink |
| os.path.samefile | Path.samefile |

Thanks

https://bugs.python.org/issue34825
(cherry picked from commit 6f9c55d1c0)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-10-05 19:06:17 +03:00
Miss Islington (bot) b3c4a050b7
bpo-34906: Doc: Fix typos (GH-9712)
(cherry picked from commit 07fbbfde1b)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-10-05 07:35:18 -07:00
Miss Islington (bot) 23fd846feb Fix a typo ssl.py docstring (GH-9697) (GH-9709)
(cherry picked from commit fc7d1b3b6a)

Co-authored-by: Matt Eaton <agnosticdev@gmail.com>
2018-10-05 10:33:36 +03: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) 484c899a5b
Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670)
(cherry picked from commit be4e5b8920)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-10-01 22:32:01 -07:00
Miss Islington (bot) cd4dd9374d
closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666)
(cherry picked from commit cbda8fc5d7)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-10-01 22:12:02 -07:00
Miss Islington (bot) 27d7f93f63 bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9663)
(cherry picked from commit 30534cc717)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2018-10-01 17:43:54 -07:00
Miss Islington (bot) 655608a111 bpo-34476: Document that asyncio.sleep() always suspends. (GH-9643) (#9654)
(cherry picked from commit cd602b8af2)

Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
2018-10-01 13:19:33 +03:00
Miss Islington (bot) 214c0b3d15
bpo-34850: Replace is with == in idlelib.iomenu (GH-9649)
Patch by Serhiy Storchaka (in PR GH-9642).
(cherry picked from commit 5fa247d60d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-09-30 14:35:53 -07: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) b0b8f9bd4e bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Switch "list" with "iterable" to match with the implementation.
(cherry picked from commit e45473e3ca)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-09-29 10:33:05 -06:00
Miss Islington (bot) 4c1b2ad44f
Fix astuple in dataclasses documentation (GH-9631)
(cherry picked from commit 508d820512)

Co-authored-by: 방성범 (Bang Seongbeom) <bangseongbeom@hotmail.com>
2018-09-29 03:55:14 -07:00
Miss Islington (bot) 758ad54dac
Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
(cherry picked from commit 4b430e5f69)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-09-28 23:01:48 -07:00
Miss Islington (bot) 007fda436f bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE (GH-9613) (GH-9619)
After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a7b2)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-09-28 06:07:56 -07:00
Miss Islington (bot) 7e35081bc8
bpo-34736: improve error message for invalid length b64decode inputs (GH-9563)
Improvements:
1. Include the number of valid data characters in the error message.
2. Mention "number of data characters" rather than "length".

https://bugs.python.org/issue34736
(cherry picked from commit 1fba2ffc37)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-09-27 23:12:54 -07:00
Miss Islington (bot) 85ccedc5b5
bpo-34802: Fix asyncio.iscoroutine() docs (GH-9611)
(cherry picked from commit 59ee5b1293)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-09-27 12:53:18 -07:00
Yury Selivanov 24cb7de15d
[3.7] bpo-34762: Update PyContext* refs to PyObject* in asyncio and decimal (GH-9610) 2018-09-27 15:33:23 -04:00
Andrés Delfino 273fc220b2 Fix markup for xml.sax entry in 3.7.1 notes (GH-9602) 2018-09-27 11:25:47 -04:00
Miss Islington (bot) addef07ca7
Fix tests in test_socket to use correctly CMSG_LEN (GH-9594)
After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_socket that are using
testFDPassSeparateMinSpace(), FreeBDS revision 337423 was pointed
out to be the reason the test started to fail.

A close examination of the manpage for cmsg_space(3) reveals that
the number of file descriptors needs to be taken into account when
using CMSG_LEN().

This commit fixes tests in test_socket to use correctly CMSG_LEN, taking
into account the number of FDs.
(cherry picked from commit 7291108d88)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-09-27 06:30:47 -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 2bdba6b429 Post release bump 2018-09-26 20:12:10 -04: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
Miss Islington (bot) 4ea64a25c2
Clarify that Type[SomeTypeVar] is legal (GH-9585)
Currently, the docs state that when doing `Type[X]`, X is only allowed to
be a class, a union of classes, and Any. This pull request amends
that sentence to clarify X may also be a typevar (or a union involving
classes, Any, and TypeVars).
(cherry picked from commit 130717fe58)

Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
2018-09-26 08:21:15 -07:00
Victor Stinner b54fc15e32
Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9586)
Fix the following warning:

Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
             strncpy(p, "ERR", 3);

(cherry picked from commit 9fb8415759)
2018-09-26 07:45:19 -07:00
Ned Deily 2064bcf6ce 3.7.1rc1 2018-09-26 02:16:09 -04:00
Miss Islington (bot) 69d63bbbd6
Fix pickletools doc for NEWFALSE. (GH-9432)
Also make docs for NEWFALSE and NEWTRUE more consistent
with docs for other opcodes.
(cherry picked from commit 488cfb78c8)

Co-authored-by: Krzysztof Wroblewski <krzysiek.wr@gmail.com>
2018-09-25 22:19:08 -07: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