Commit Graph

43298 Commits

Author SHA1 Message Date
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) 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) 984a800e08
unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028)
The docs in `library/unittest.mock` have been updated to remove
confusing terms about submock and be explicit about the behavior
expected.
(cherry picked from commit 96200eb2ff)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-10-19 15:17:31 -07: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
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) 350aeab812
bpo-34783: Fix test_nonexisting_script() (GH-9896)
Fix test_cmd_line_script.test_nonexisting_script(): the test must not
rely on sys.executable, since main.c uses config->program which can
be different than sys.executable in many cases (for example, on macOS
when using the framework).
(cherry picked from commit ea75187c68)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-10-15 15:30:05 -07: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
Miss Islington (bot) 77e0abe228
bpo-33656: Move pyshell ctypes import inside try block. (GH-9858)
A Windows build with _tkinter, tkinter, and idlelib
but without ctypes is unlikely but apparently possible.
(cherry picked from commit d274afb5e5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-10-13 17:19:22 -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) d07564274a
Add new tests for bytes and bytearray constructors. (GH-9843)
Covered all special cases: bytes, tuple, list, differend
kinds of iterables and iterators.
(cherry picked from commit 1a997eb291)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-13 11:02:23 -07: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
Miss Islington (bot) 5d8ef8bc3f bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) (GH-9832)
With macOS framework builds, test case test_nonexisting_script in
test_nonexisting_script fails because the test case assumes that
the file name in sys.executable will appear in the error message.
For macOS framework builds, sys.executable is the file name of the
stub launcher and its file name bears no relationship to the file
name of the actual python executable.  For now, skip the test in
this case.
(cherry picked from commit f6c29a65e2)

Co-authored-by: Ned Deily <nad@python.org>
2018-10-13 00:07:01 -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
Miss Islington (bot) c327a5499f
bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052)
(cherry picked from commit 65d2f8c044)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-12 01:49:07 -07: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) 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) 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) 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
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) 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) 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) 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) 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) 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) 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 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
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
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) b2ae550298
bpo-34162: idlelib/NEWS.txt entry for squeezer (GH-9573)
(cherry picked from commit 22ef31d0b4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-09-25 11:02:06 -07:00
Miss Islington (bot) ef1173ab14
bpo-33937: Catch ENOMEM error in test_socket (GH-9557)
Fix test_socket.SendmsgSCTPStreamTest: catch ENOMEM error.
testSendmsgTimeout() and testSendmsgDontWait() randomly fail on
Travis CI with: "OSError: [Errno 12] Cannot allocate memory".
(cherry picked from commit 46f40be8b9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-09-25 08:49:28 -07:00