Commit Graph

21431 Commits

Author SHA1 Message Date
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
Miss Islington (bot) aeadf59e45
bpo-34548: IDLE: use configured theme colors in TextView (GH-9008)
https://bugs.python.org/issue34548
(cherry picked from commit c87d9f406b)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-09-23 06:31:35 -07:00
Christian Heimes 2756ef3165 [3.7] bpo-34670: Add TLS 1.3 post handshake auth (GH-9460) (GH-9505)
Add SSLContext.post_handshake_auth and
SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake
authentication.

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

https://bugs.python.org/issue34670.
(cherry picked from commit 9fb051f032)

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



https://bugs.python.org/issue34670
2018-09-23 00:22:52 -07:00
Miss Islington (bot) 44989bc269 bpo-34472: Add data descriptor signature to zipfile (GH-8871) (GH-9399)
This makes streamed zips compatible with MacOS Archive Utility and
other applications.
(cherry picked from commit 4ba3b50bfe)

Co-authored-by: Silas Sewell <silas@sewell.org>
2018-09-22 21:03:04 +03:00
Ethan Furman 0c076caaa8
[3.7] bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328) (GH-9486)
* bpo-29577: allow multiple mixin classes
2018-09-21 22:26:32 -07:00
Miss Islington (bot) 5c3d8b2efd
[3.7] bpo-34623: Mention CVE-2018-14647 in news entry (GH-9482) (GH-9488)
https://bugs.python.org/issue34623
(cherry picked from commit 026337a710)


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


https://bugs.python.org/issue34623
2018-09-21 21:57:46 -07:00
Miss Islington (bot) e5fde1f992
bpo-34537: Fix test_gdb:test_strings with LC_ALL=C (GH-9483)
We cannot simply call locale.getpreferredencoding() here,
as GDB might have been linked against a different version
of Python with a different encoding and coercion policy
with respect to PEP 538 and PEP 540.

Thanks to Victor Stinner for a hint on how to fix this.
(cherry picked from commit 7279b5125e)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-09-21 18:29:34 -07:00
Miss Islington (bot) 187f2dd256
bpo-34762: Fix contextvars C API to use PyObject* pointer types. (GH-9473)
(cherry picked from commit 2ec872b31e)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-09-21 12:48:10 -07:00
Miss Islington (bot) 975f3cb1f2
bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)
There was a missing PyMem_Free(format) in time_strftime().
(cherry picked from commit 91e6c8717b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-09-21 00:41:50 -07:00
Miss Islington (bot) 015cd0f5cb bpo-32215: Fix performance regression in sqlite3 (GH-8511)
(cherry picked from commit 8d1e190fc5)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-09-20 18:56:56 +03:00
Victor Stinner 95cc3ee00c
Revert "[3.7] bpo-34589: Add -X coerce_c_locale option; C locale coercion off by default (GH-9379)" (GH-9416)
This reverts commit 144f1e2c6f.
2018-09-19 12:01:52 -07:00
Miss Islington (bot) 1a89cb5c47 bpo-34582: Adds JUnit XML output for regression tests (GH-9210)
(cherry picked from commit d0f49d2f50)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-09-18 11:48:22 -07:00
Miss Islington (bot) 470a435f3b
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
The C accelerated _elementtree module now initializes hash randomization
salt from _Py_HashSecret instead of libexpat's default CPRNG.

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

https://bugs.python.org/issue34623
(cherry picked from commit cb5778f00c)

Co-authored-by: Christian Heimes <christian@python.org>
2018-09-18 06:11:09 -07:00
Victor Stinner 144f1e2c6f
[3.7] bpo-34589: Add -X coerce_c_locale option; C locale coercion off by default (GH-9379)
* bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)

_PyCoreConfig:

* Rename coerce_c_locale to _coerce_c_locale
* Rename coerce_c_locale_warn to _coerce_c_locale_warn

These fields are now private (name prefixed by "_").

(cherry picked from commit 188ebfa475)

* bpo-34589: C locale coercion off by default (GH-9073)

Py_Initialize() and Py_Main() cannot enable the C locale coercion
(PEP 538) anymore: it is always disabled. It can now only be enabled
by the Python program ("python3).

test_embed: get_filesystem_encoding() doesn't have to set PYTHONUTF8
nor PYTHONCOERCECLOCALE, these variables are already set in the
parent.

(cherry picked from commit 7a0791b699)

* bpo-34589: Add -X coerce_c_locale command line option (GH-9378)

Add a new -X coerce_c_locale command line option to control C locale
coercion (PEP 538).

(cherry picked from commit dbdee0073c)
2018-09-17 18:01:39 -07:00
Miss Islington (bot) b7f58d7f80
bpo-34587, test_socket: remove RDSTest.testCongestion() (GH-9277)
The test tries to fill the receiver's socket buffer and expects an
error. But the RDS protocol doesn't require that. Moreover, the Linux
implementation of RDS expects that the producer of the messages
reduces its rate, it's not the role of the receiver to trigger an
error.

The test fails on Fedora 28 by design, so remove it.
(cherry picked from commit 7484bdfd1e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-09-17 14:27:59 -07:00
Miss Islington (bot) 1229664f30
bpo-32533: Fixed thread-safety of error handling in _ssl. (GH-7158)
(cherry picked from commit c6fd1c1c3a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-09-17 12:12:13 -07:00
Miss Islington (bot) efdf316d23
bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)
(cherry picked from commit 9bdb7be482)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-17 06:08:45 -07:00
Miss Islington (bot) e2c0aea670
bpo-34710: fix SSL module build (GH-9347)
Include ``openssl/dh.h`` header file to fix implicit function declaration of ``DH_free()``.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
(cherry picked from commit b3a271fc0c)

Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2018-09-17 05:18:23 -07:00
Miss Islington (bot) 1d30788493
bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113)
(cherry picked from commit e0e5065dae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-17 05:10:56 -07:00
Miss Islington (bot) e3f6aa7fe4
bpo-34603, ctypes/libffi_msvc: Fix returning structs from functions (GH-9258)
(cherry picked from commit 7843caeb90)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-09-15 22:53:13 -07:00
Miss Islington (bot) 51dbae867e
closes bpo-34515: Support non-ASCII identifiers in lib2to3. (GH-8950)
(cherry picked from commit 10a428b64b)

Co-authored-by: Monson Shao <holymonson@gmail.com>
2018-09-15 10:52:57 -07:00
Miss Islington (bot) c83c375ed9 bpo-32933: Implement __iter__ method on mock_open() (GH-5974)
(cherry picked from commit 2087023fde)

Co-authored-by: Tony Flury <anthony.flury@btinternet.com>
2018-09-15 00:30:04 +03:00
Miss Islington (bot) 78aa3d8f52 bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are namedtuples. (GH-9151) (GH-9304)
(cherry picked from commit 9b9d97dd13)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-09-14 13:47:14 -04:00
Andrew Svetlov d0491cd7fd
[3.7] bpo-34490: Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (GH-8907) (#9286)
* [3.7] Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (GH-8907).
(cherry picked from commit 413118ebf3)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>

* Update test_events.py
2018-09-13 17:03:35 -07:00
Miss Islington (bot) 1550b73112
closes bpo-34661: Fix test_shutil if unzip doesn't support -t. (GH-9262)
(cherry picked from commit a710ebd21b)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-13 10:27:52 -07:00
Miss Islington (bot) b2ff9a9f92
bpo-34658: Fix rare subprocess prexec_fn fork error. (GH-9255)
[bpo-34658](https://www.bugs.python.org/issue34658): Fix a rare interpreter unhandled exception state SystemError only
seen when using subprocess with a preexec_fn while an after_parent handler has
been registered with os.register_at_fork and the fork system call fails.

https://bugs.python.org/issue34658
(cherry picked from commit a20b6adb5a)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-09-13 10:11:00 -07:00
Miss Islington (bot) 90f7d455b7
bpo-34200: Fix non-determinism of test_pkg (GH-9248)
This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code.

https://bugs.python.org/issue34200
(cherry picked from commit 4ae8ece5cd)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-09-12 18:29:08 -07:00
Miss Islington (bot) 98344a4f2f
closes bpo-34652: Always disable lchmod on Linux. (GH-9234)
(cherry picked from commit 40caa05fa4)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-12 16:36:05 -07:00
Miss Islington (bot) 329ea4ef7c
bpo-31577: Fix a crash in os.utime() in case of a bad ns argument. (GH-3752)
(cherry picked from commit 0bd1a2dcfd)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-09-12 12:46:30 -07:00
Miss Islington (bot) 72c34cf6dd
closes bpo-31903: Release the GIL when calling into SystemConfiguration (GH-4178)
(cherry picked from commit 4859ba0d2c)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-09-12 08:37:30 -07:00
Benjamin Peterson cadb66e173
[3.7] closes bpo-25041: Document AF_PACKET socket address format. (GH-9207)
(cherry picked from commit 731ff68eee)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-09-11 18:46:36 -07:00
Miss Islington (bot) d8bc7a666b
closes bpo-31902: Fix the col_offset attribute for ast.Async* nodes to point to the "async" keyword. (GH-4175)
Previously, col_offset points to the keyword after "async".
(cherry picked from commit 90fc8980bb)

Co-authored-by: guoci <zguoci@gmail.com>
2018-09-11 15:21:11 -07:00
Miss Islington (bot) 536e45accf
closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque with a bad __new__(). (GH-3788)
(cherry picked from commit 24bd50bdcc)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-09-11 12:08:10 -07:00
Miss Islington (bot) 3e648f8371
bpo-28617 Fixed docs inaccuracies about the types that support membership tests (GH-9086)
<!-- issue-number: [bpo-28617](https://www.bugs.python.org/issue28617) -->
https://bugs.python.org/issue28617
<!-- /issue-number -->
(cherry picked from commit 08bcf647d8)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-09-11 11:13:33 -07:00
Miss Islington (bot) 3235fac0d7 bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds (GH-9166) (GH-9167)
(cherry picked from commit 3102e24d83)

Co-authored-by: Ned Deily <nad@python.org>
2018-09-11 09:07:11 -07:00
Miss Islington (bot) 2bc4eea8f6
bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150)
(cherry picked from commit 5033aa77aa)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-10 21:55:27 -07:00
Miss Islington (bot) 9c4a63fc17 bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9148)
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also b89b52f284

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2018-09-10 21:36:20 -07:00
Miss Islington (bot) 037582eb7f
bpo-33460: remove ellipsis that look like continuation prompts (GH-7851)
Remove ellipsis that look like continuation prompts,
has a side benefit of putting rest of error message in proper text color.
(cherry picked from commit f019579828)

Co-authored-by: Lew Kurtz <37632626+lew18@users.noreply.github.com>
2018-09-10 18:49:39 -07:00
orlnub123 c0d63bf73b [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034)
* Fix Enum._convert shadowing members named _convert
2018-09-10 09:39:48 -07:00
Miss Islington (bot) 4902017430
bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)
The recursive frame pruning code always undercounted the number of elided frames
by one. That is, in the "[Previous line repeated N more times]" message, N would
always be one too few. Near the recursive pruning cutoff, one frame could be
silently dropped. That situation is demonstrated in the OP of the bug report.

The fix is to start the identical frame counter at 1.
(cherry picked from commit d545869d08)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-10 09:00:08 -07:00
Tal Einat d53f1cabe8
[3.7] bpo-34621: fix uuid.UUID (un)pickling compatbility with older Python versions (<3.7) (GH-9133) 2018-09-10 18:47:29 +03:00
William Grzybowski 7a633ed79c [3.7] bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098) (GH-9104)
Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8..
(cherry picked from commit 28658485a5)

Co-authored-by: William Grzybowski <wg@FreeBSD.org>
2018-09-09 13:27:31 +02:00
Miss Islington (bot) 77b92b15a5
bpo-34421 avoid unicode error in distutils logging (GH-8799)
This caused installation errors in some cases on Windows.
Patch by Julien Malard.
(cherry picked from commit 0afada163c)

Co-authored-by: Julien Malard <julien.malard@mail.mcgill.ca>
2018-09-08 13:52:59 -07:00
Miss Islington (bot) 9835696ec4
bpo-34246: Use no mutable default args in smtplib (GH-8554)
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
(cherry picked from commit d5fbe9b1a3)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2018-09-07 15:29:27 -07:00
Zackery Spytz 18d7dff1bb [3.7] bpo-34594: Don't hardcode errno values in the tests. (GH-9094)
(cherry picked from commit b03c2c5190)
2018-09-07 09:17:32 -07:00
Miss Islington (bot) f862f3abae
bpo-25750: fix refcounts in type_getattro() (GH-6118)
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485ac)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-09-07 00:50:35 -07:00
Miss Islington (bot) 2d3f2dc9f8 bpo-34542: Update test certs and keys (GH-8997) (GH-9007)
Update all test certs and keys to use future proof crypto settings:

* 3072 bit RSA keys
* SHA-256 signature

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e6dac00779)
2018-09-06 15:13:24 +02:00
Miss Islington (bot) 5b17d7fccd
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
(cherry picked from commit 874809ea38)

Co-authored-by: Erik Janssens <erik.janssens@conceptive.be>
2018-09-04 23:45:03 -07:00
Miss Islington (bot) e8ca8806a9 bpo-34563: Fix for invalid assert on big output of multiprocessing.Process (GH-9027) (GH-9064)
Fix for invalid assert on big output of multiprocessing.Process.
(cherry picked from commit 266f4904a2)

Co-authored-by: Alexander Buchkovsky <olex.buchkovsky@gmail.com>
2018-09-04 21:39:54 +02:00
Miss Islington (bot) 7aa3eadca2
bpo-34530: Fix distutils find_executable() (GH-9049)
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 39487196c8)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-09-04 05:19:13 -04:00
Miss Islington (bot) 4c532da120
closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H (GH-9016)
(cherry picked from commit 2d7102e726)

Co-authored-by: Thomas Herzog <thomas@mcduke.net>
2018-09-01 18:30:44 -04:00
Miss Islington (bot) 89c9043ee0
bpo-34558: Add missing parentheses in _aix.py (GH-9017)
p.wait()
(cherry picked from commit 172a71f19b)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2018-08-31 22:46:32 -04:00
Miss Islington (bot) 5df3658f2d
bpo-34062: Add missing launcher argument and make behavior consistent between short and long arguments (GH-8827)
Added previously missing "--list" argument.
Made "--list" and "--list-paths" behavior consistent with the corresponding "-0" and "-0p" arguments.
(cherry picked from commit aada63b20e)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
2018-08-31 11:32:22 -04:00
Victor Stinner 0b9ea4b211
[3.7] bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) (GH-8987)
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)

Standard streams like sys.stdout now use the "surrogateescape" error
handler, instead of "strict", on the POSIX locale (when the C locale is not
coerced and the UTF-8 Mode is disabled).

Add tests on sys.stdout.errors with LC_ALL=POSIX.

Fix the error handler of standard streams like sys.stdout:
PYTHONIOENCODING=":" is now ignored instead of setting the error handler to
"strict".

(cherry picked from commit 315877dc36)
2018-08-29 11:01:33 +02:00
Victor Stinner 65ef7425a3
bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) (GH-8974)
* The UTF-8 Mode is now also enabled by the "POSIX" locale, not only
  by the "C" locale.
* On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
  the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
  the LC_CTYPE locale is "C".
* test_utf8_mode.test_cmd_line() checks also that the command line
  arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled
  with POSIX locale or C locale.

(cherry picked from commit 5cb258950c)
2018-08-28 13:51:20 +02:00
Miss Islington (bot) 2cf33161f7
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
(cherry picked from commit 216b745eaf)

Co-authored-by: Przemysław Spodymek <przemyslaw@spodymek.com>
2018-08-27 18:37:18 -04:00
Miss Islington (bot) 55b8c4bff8
Remove AIX workaround test_subprocess (GH-8939)
An old apparent AIX behavior workaround in test_subprocess's
test_undecodable_env is no longer needed.
(cherry picked from commit 89d79b1449)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2018-08-26 20:32:48 -04:00
Miss Islington (bot) 80e9fedcf5
bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)
(cherry picked from commit c406d5cd74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-08-25 03:47:22 -04:00
Miss Islington (bot) d5f017bbd6
bpo-13312: Avoid int underflow in time year. (GH-8912)
Avoids an integer underflow in the time module's year handling code.
(cherry picked from commit 76be0fffff)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-08-25 01:53:00 -04:00
Miss Islington (bot) 0dc75f0457
bpo-34426: fix typo (__lltrace__ -> __ltrace__) (GH-8822)
(cherry picked from commit 09efe49c07)

Co-authored-by: Danish Prakash <grafitykoncept@gmail.com>
2018-08-24 22:14:11 -04:00
Miss Islington (bot) 3e6020c4dd
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864)
(cherry picked from commit 91cb298f81)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-08-24 10:44:47 -04:00
Miss Islington (bot) 89b1654e0b
bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)
The current C implementations **crash** if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.

Important notes:

1.  It is possible to pass a non-UTF-8 string as a separator to the
    `.isoformat()` methods.
2.  The pure-Python `datetime.fromisoformat()` implementation accepts
    strings with a surrogate as the separator.

In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
(cherry picked from commit 096329f0b2)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
2018-08-23 11:54:33 -04:00
Miss Islington (bot) d1f0ccc7e6
bpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid __subclasses__ (GH-8835)
The missing NULL check was reported by Svace static analyzer.
(cherry picked from commit cdbf50cba1)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-08-20 16:42:18 -04:00
Miss Islington (bot) 870247a57e [3.7] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (GH-8789)
Read from data socket to avoid "[SSL] shutdown while in init" exception
during shutdown of the dummy server.

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

<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
https://bugs.python.org/issue34391
<!-- /issue-number -->
(cherry picked from commit 1590c39336)


Co-authored-by: Christian Heimes <christian@python.org>
2018-08-16 21:37:20 +02:00
Miss Islington (bot) 64336dc0a5
bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. (GH-8775)
(cherry picked from commit 864a892af3)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-08-15 16:55:10 -04:00
Miss Islington (bot) 2275b773eb
closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)
Avoid undefined pointer arithmetic with NULL.
(cherry picked from commit 7c4ab2afb1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-08-15 02:51:12 -04:00
Miss Islington (bot) e3228a3f44 bpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8763)
Downstream vendors have started to deprecate weak keys. Update all RSA keys
and DH params to use at least 2048 bits.

Finite field DH param file use RFC 7919 values, generated with

    certtool --get-dh-params --sec-param=high

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 88bfd0bce0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-08-14 16:52:27 +02:00
Miss Islington (bot) 32e58fc321
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
(cherry picked from commit 4d12e4dc28)

Co-authored-by: Vadim Pushtaev <pushtaev.vm@gmail.com>
2018-08-12 20:32:44 -07:00
Miss Islington (bot) 39c1253bd1
closes bpo-34377: Update Valgrind suppressions. (GH-8729)
Valgrind isn't seeing PyObject_Free/PyObject_Realloc, but using _PyObject_Free/_PyObject_Realloc works.
(cherry picked from commit db6075ab3a)

Co-authored-by: Paul Price <price@astro.princeton.edu>
2018-08-11 00:29:32 -07:00
Miss Islington (bot) c614121224 bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)
(cherry picked from commit 423d05f6f5)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-08-11 09:00:11 +03:00
Miss Islington (bot) ea8835fb30
bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)
(cherry picked from commit 077059e0f0)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-09 23:43:06 -07:00
Miss Islington (bot) 5799e5a84c bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
(cherry picked from commit e4dcbbd7f4)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-08-07 05:37:38 +03:00
Miss Islington (bot) 416f3435c5
bpo-19891: Ignore error while writing history file (GH-8483)
(cherry picked from commit b2499669ef)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2018-08-06 02:03:43 -07:00
Victor Stinner 0c90d6f759
[3.7] bpo-34247: Fix Python 3.7 initialization (#8659)
* -X dev: it is now possible to override the memory allocator using
  PYTHONMALLOC even if the developer mode is enabled.
* Add _Py_InitializeFromConfig()
* Add _Py_Initialize_ReadEnvVars() to set global configuration
  variables from environment variables
* Fix the code to initialize Python: Py_Initialize() now also reads
  environment variables
* _Py_InitializeCore() can now be called twice: the second call
  only replaces the configuration.
* Write unit tests on Py_Initialize() and the different ways to
  configure Python
* The isolated mode now always sets Py_IgnoreEnvironmentFlag and
  Py_NoUserSiteDirectory to 1.
* pymain_read_conf() now saves/restores the configuration
  if the encoding changed
2018-08-05 12:31:59 +02:00
Miss Islington (bot) e65ec491fb
bpo-33839: refactor IDLE's tooltips & calltips, add docstrings and tests (GH-7683)
* make CallTip and ToolTip sub-classes of a common abstract base class
* remove ListboxToolTip (unused and ugly)
* greatly increase test coverage
* tested on Windows, Linux and macOS
(cherry picked from commit 87e59ac11e)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-04 23:47:28 -07:00
Miss Islington (bot) ffd6364745
bpo-34275: Make IDLE calltips always visible on Mac. (GH-8639)
Some MacOS-tk combinations need .update_idletasks().
The call is both unneeded and innocuous on Linux and Windows.
Patch by Kevin Waltzer.
(cherry picked from commit 9beaef6225)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-08-02 20:39:36 -07:00
Miss Islington (bot) d9fc795487
bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
Added missing .grab_release() calls to all places where we call .grab_set().
(cherry picked from commit 10ea9409ce)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-01 23:37:50 -07:00
Miss Islington (bot) 172a81e42b [3.7] bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532) (GH-8586) 2018-07-31 11:29:07 -04:00
Miss Islington (bot) 3e4b688759
bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)
* Fix integer overflow in os.readv(), os.writev(), os.preadv()
  and os.pwritev() and in os.sendfile() with headers or trailers
  arguments (on BSD-based OSes and MacOS).

* Fix sending the part of the file in os.sendfile() on MacOS.
  Using the trailers argument could cause sending more bytes from
  the input file than was specified.

Thanks Ned Deily for testing on 32-bit MacOS.
(cherry picked from commit 9d5727326a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-31 02:20:06 -07:00
Serhiy Storchaka 47957dab94
[3.7] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581)
* help(hashlib) didn't work because of incorrect module name in blake2b and
  blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
  accepted keyword argument "string" for binary data, but documented as
  accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
  keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
  which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
  positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
  shake_*() and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

* More accurately specified input and result types for strings, bytes and
  bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.
(cherry picked from commit f1d36d8efa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-31 10:22:44 +03:00
Miss Islington (bot) 9ecbe3321f
Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (GH-3771)" (GH-8241)
This reverts commit af810b35b4.

This is not valid syntax (see bpo-32012).
(cherry picked from commit 4b8a7f51da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-30 23:52:49 -07:00
Miss Islington (bot) d5c75be555
bpo-33833: Fix ProactorSocketTransport AssertionError (GH-7893)
(cherry picked from commit 9045199c5a)

Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
2018-07-30 13:04:30 -07:00
Miss Islington (bot) ad4f64d58c
bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)
(cherry picked from commit 3f8c6913b8)

Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
2018-07-29 12:57:21 -07:00
Miss Islington (bot) 5753b13cb9
bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)
(cherry picked from commit d2e902e4fb)

Co-authored-by: Franz Wöllert <franz.woellert@gmail.com>
2018-07-29 08:42:18 -07:00
Steve Dower 6332de10c7
bpo-34231: PYTHONBREAKPOINT is not documented on python --help (GH-8475) 2018-07-29 12:17:49 +01:00
Miss Islington (bot) c3af73d580 bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. (GH-7911)
(cherry picked from commit ce75df3031)

Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
2018-07-29 10:32:02 +01:00
Miss Islington (bot) 1e98d87961
bpo-34251: Restore msilib.Win64 to preserve compatibility (GH-8510)
(cherry picked from commit 11eb1a9470)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-28 17:14:44 -07:00
Miss Islington (bot) 2be0124b82
bpo-33476: Fix _header_value_parser when address group is missing final ';' (GH-7484)
(cherry picked from commit 8fe9eed937)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-28 08:41:26 -07:00
Miss Islington (bot) 7cbde0e09d bpo-30722: Fix NEWS entries (GH-8501)
(cherry picked from commit 612dbefe9d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-27 19:17:20 +03:00
Steve Dower 3cc505e950
bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. (GH-8464) 2018-07-26 17:17:02 +01:00
Miss Islington (bot) 89352b08aa bpo-32663 Make SMTPUTF8SimTests run (GH-5314) (#8471)
Enable and fix SMTPUTF8SimTests in test_smtplib.

The tests for SMTPUTF8SimTests in test_smtplib.py were not actually
being run because test_smtplib was still using the 'test_main' pattern,
and the class was never added to test_main.

Additionally, one of the tests needed to be moved to the non-UTF8 server
class because it relies on the server not being UTF-8 compatible (and it
had a bug in in).
(cherry picked from commit 48ed88a93b)

Co-authored-by: chason <chason@gmail.com>
2018-07-26 09:58:16 -04:00
Miss Islington (bot) 973649342c bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385) (GH-8466)
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.
(cherry picked from commit 96d1e69a12)

Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
2018-07-25 16:34:09 -04:00
Miss Islington (bot) 0b27169183 bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351) (GH-8435)
Now base64.Error is always raised instead of UnboundLocalError or
OverflowError.
(cherry picked from commit ac0b3c2f4d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-24 13:53:39 +03:00
Miss Islington (bot) 96bba049f4 bpo-33336, imaplib: Legalize MOVE command (GH-6569) (GH-8409)
imaplib now allows MOVE command in IMAP4.uid() (RFC 6851:
IMAP MOVE Extension) and potentially as a name of supported
method of IMAP4 object.
(cherry picked from commit caa331d492)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2018-07-23 15:54:46 +02:00
Miss Islington (bot) 05a72f15f7 bpo-21446: Update reload fixer to use importlib (GH-8391)
(cherry picked from commit 7a3056fa7d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-23 11:11:22 +03:00
Miss Islington (bot) 14f58f0ff8 bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
(cherry picked from commit d04f46c59f)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-23 09:51:54 +03:00
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
Miss Islington (bot) d554414d98
bpo-33905: Add test for idlelib.stackview.StackBrowser. (GH-7852)
Increases coverage by 44%.
(cherry picked from commit bcd3a1a18d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-21 19:48:45 -07:00
Miss Islington (bot) e1f0dceb26
bpo-33924: Change IDLE mainmenu.menudefs key 'windows' to 'window' (GH-7836)
Every other menudef key is the lowercase version of the
corresponding main menu entry (in this case, 'Window').
(cherry picked from commit 33c7420e7d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 21:35:47 -07:00
Miss Islington (bot) f9243a22da
bpo-33906: Rename idlelib.windows as window (GH-7833)
Match Window on the main menu and remove last plural module name.
Change imports, test, and attribute references to match new name.
(cherry picked from commit a361e89d5a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 18:45:36 -07:00
Miss Islington (bot) a717c5646b
bpo-33917: Fix and document idlelib/idle_test/template.py (GH-7830)
The revised file compiles, runs, and tests OK. idle_test/README.txt
explains how to use it to create new IDLE test files.
(cherry picked from commit 87a927325e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 14:27:43 -07:00
Miss Islington (bot) b0f352680e
bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (GH-7811)
(cherry picked from commit 9bb92235f6)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
2018-06-20 08:56:22 -07:00
Miss Islington (bot) 232add0241
bpo-33746: Fix test_unittest.testRegisterResult() in verbose mode (GH-7799)
Only make sure that the result is in unittest.signals._results, don't
check the full content of unittest.signals._results.

support._run_suite() uses TextTestRunner in verbose mode, but
TextTestRunner.run() calls registerResult(result) which made the test
fail with "odd object in result set".

Call also removeResult() to restore unittest.signals._results to
avoid test side effect.
(cherry picked from commit fd8fbce495)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-20 02:50:03 -07:00
Miss Islington (bot) ce52f5ee09
bpo-33907: Rename an IDLE module and classes. (GH-7810)
Fix-up class name duplication in PR GH-7807. Combined effect is that
module calltips and its class CallTips are now calltip and Calltip.
In module calltip_w class CallTip is now CalltipWindow.
(cherry picked from commit 9af1836664)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-19 23:40:14 -07:00
Miss Islington (bot) b89a376b3b
bpo-33907: Rename an IDLE module and class. (GH-7807)
Improve consistency and appearance. Module idlelib.calltips is now calltip.
Class idlelib.calltip_w.CallTip is now Calltip.
(cherry picked from commit 06e2029dfa)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-19 20:27:37 -07:00
Victor Stinner 13c79c677f
bpo-33901: Fix test_dbm_gnu for gdbm 1.15 (GH-7798)
Fix test_dbm_gnu.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.
2018-06-19 18:19:23 +02:00
Miss Islington (bot) 2edcf0a3db
bpo-33365: print the header values beside the keys (GH-6611)
with debuglevel=1 only the header keys got printed. With
this change the header values get printed as well and the single
header entries get '\n' as a separator.
(cherry picked from commit 936f03e7fa)

Co-authored-by: Marco Strigl <mstrigl@suse.com>
2018-06-19 06:52:36 -07:00
Miss Islington (bot) 53d1e9fad3
bpo-33663: Convert content length to string before putting to header (GH-7754)
(cherry picked from commit b36b0a3765)

Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
2018-06-18 14:37:56 -07:00
Miss Islington (bot) 6bb7704451
bpo-33856: Add "help" to the welcome message of IDLE (GH-7755)
Make it the same as when one runs 'python'.
(cherry picked from commit 9d49f85064)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-06-16 14:37:55 -07:00
Miss Islington (bot) 5085687645
bpo-33855: Minimally test all IDLE modules. (GH-7689)
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es).  Add a test file for all non-startup IDLE modules.  Edit existing files and update coverage.  This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.
(cherry picked from commit ee5ef309c7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-15 15:38:35 -07:00
Miss Islington (bot) 046da16695
bpo-33824, bpo-32030: Fix pymain_read_conf() (GH-7712)
Fix "LC_ALL=C python3.7 -V": reset properly the command line parser
when the encoding changes after reading the Python configuration.

Fix pymain_read_conf(): use memset(0) to reset properly cmdline.
(cherry picked from commit 6c5a4b3156)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-15 15:26:29 -07:00
Victor Stinner ba67b4f7cb
Revert "bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)" (#7724)
This reverts commit 9b7c74ca32.
2018-06-15 23:37:33 +02:00
Miss Islington (bot) c05c0e045c
bpo-33847: Add '@' operator entry to index (GH-7669)
(cherry picked from commit 695118600f)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-06-15 12:42:30 -07:00
Victor Stinner ca4cb8492c
[3.7] bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7710)
* bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692)

python-gdb now catchs ValueError on read_var(): when Python has no
debug symbols for example.

(cherry picked from commit 019d33b7a4)

* bpo-32962: python-gdb catchs UnicodeDecodeError (GH-7693)

python-gdb now catchs UnicodeDecodeError exceptions when calling
string().

(cherry picked from commit d22fc0bc7d)

* bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)

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.

(cherry picked from commit 9b7c74ca32)
2018-06-15 19:11:45 +02:00
Miss Islington (bot) 0e2b76ea4e
bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958)
Hangul composition check boundaries are wrong for the second character
([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3)
instead of [0x11A7, 0x11C3]).
(cherry picked from commit d134809cd3)

Co-authored-by: Wonsup Yoon <pusnow@me.com>
2018-06-15 05:21:55 -07:00
Miss Islington (bot) a50b825c18
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-15 01:25:13 -07:00
Miss Islington (bot) 7b82281c80 bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7664)
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it.  The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
(cherry picked from commit c3f55be7dd)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-12 16:46:11 +03:00
Ned Deily dfad352267 3.7.0rc1 2018-06-12 00:46:50 -04:00
Miss Islington (bot) a5db479ac4 bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530) (GH-7649)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were
misleading and partly wrong. It fails to explain that OpenSSL behaves
differently in client and server mode. Also OpenSSL does validate the
cert chain everytime. With SSL_VERIFY_NONE a validation error is not
fatal in client mode and does not request a client cert in server mode.
Also discourage people from using CERT_OPTIONAL in client mode.
(cherry picked from commit ef24b6c54d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-06-11 19:20:24 -04:00
Miss Islington (bot) 60b8274fec
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
(cherry picked from commit 46c5cd0f6e)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-06-11 13:44:16 -07:00
Miss Islington (bot) 144a8670f2
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should
make text and lines sharper. It should otherwise have no effect.

Using a magnifier, I determined that the improvement comes from horizontal and
lines being better lined up with the monitor pixels. I checked that this call causes
no problem on any Windows buildbot, including the Win7 buildbots. Unlike most
IDLE patches, this one can be easily reverted by users by removing a few lines,
at the top of idlelib/pyshell.py.
(cherry picked from commit 800415e3df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 11:35:13 -07:00
Miss Islington (bot) a9846e0c70 pypi.python.org -> pypi.org (GH-7613) (GH-7614)
(cherry picked from commit 9d6d06e806)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 01:05:22 -04:00
Miss Islington (bot) ec4343c3b4 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7606)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting.  This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
(cherry picked from commit 2487f30d55)

Co-authored-by: Steve Weber <steverweber@gmail.com>
2018-06-10 21:21:35 -04:00
Miss Islington (bot) 037e912552 bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7600)
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
(cherry picked from commit 877b23202b)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-10 18:02:24 -04:00
Miss Islington (bot) 053d6c5ce2 bpo-33770: improve base64 exception message for encoded inputs of invalid length (GH-7416) (GH-7602)
(cherry picked from commit 1b85c71a21)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:37:14 -04:00
Miss Islington (bot) 066e16de8e Fix spaces added after hyphens in news entries. (GH-7579) (GH-7582)
Seems they were added by double applying blurb.
(cherry picked from commit 98a0e466cd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-10 14:53:21 -04:00
Michael Felt 20cd5c6e21 bpo-32493: Correct test for uuid_enc_be availability in configure.ac. (GH-7511) 2018-06-09 17:59:02 -04:00
Miss Islington (bot) dd613cf335
bpo-33409: Clarify PEP 538/540 relationship (GH-7534)
While locale coercion and UTF-8 mode turned out to
be complementary ideas rather than competing ones,
it isn't immediately obvious why it's useful to
have both, or how they interact at runtime.

This updates both the Python 3.7 What's New doc
and the PYTHONCOERCECLOCALE and PYTHONUTF8
documentation in an attempt to clarify that
relationship:

- in the respective What's New sections, add a closing paragraph
  explaining which problem each one solves, and pointing to the
  other PEP's section for the specific aspects it relies on the other
  PEP to solve
- use "locale-aware mode" as a more descriptive term for the
  default non-UTF-8 mode
- improve wording conistenccy between the PYTHONCOERCECLOCALE
  and PYTHONUTF8 docs when they cover the same thing (mostly
  related to legacy locale detection and setting the standard
  stream error handler)
- improve the description of the locale coercion trigger conditions
  (including pointing out that setting LC_ALL turns off locale coercion)
- port the full description of the UTF-8 mode behaviour changes
  from PEP 540 into the PYTHONUTF8 documentation
- be explicit that PYTHONIOENCODING still overrides the settings
  for the standard streams
- mention concrete examples of things that do and don't get their
  text encoding assumptions adjusted by the two text encoding
  assumption override techniques
(cherry picked from commit 1bcb8a6368)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-06-09 00:13:53 -07:00
Miss Islington (bot) 21f4c780a1
bpo-30805: Avoid race condition with debug logging (GH-7545)
Supersedes https://github.com/python/cpython/pull/2490
(cherry picked from commit 12f482e0ae)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-08 15:42:07 -07:00
Miss Islington (bot) f4dcf49159
bpo-33736: Improve the documentation of asyncio stream APIs (GH-7326)
(cherry picked from commit c0d062f523)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-06-08 08:54:31 -07:00
Miss Islington (bot) 842985f6c7
bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)
- bugfix and test for fragile metavar handling in argparse (see
  bpo-24089, bpo-14046, bpo-25058, bpo-11874)
- also fixes some incorrect tests that did not make 1-element tuples correctly
(cherry picked from commit 66f02aa32f)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-06-08 04:33:50 -07:00
Miss Islington (bot) a4868473e7
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
(cherry picked from commit 041272b657)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-07 22:50:36 -07:00
Miss Islington (bot) 0738443a5b
bpo-33792: Add selector and proactor windows policies (GH-7487)
(cherry picked from commit 8f4042964d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 18:31:50 -07:00
Miss Islington (bot) a971a6fdb1 bpo-33803: Fix a crash in hamt.c (GH-7504) (GH-7505)
(cherry picked from commit 378c53cc31)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 20:44:09 -04:00
Miss Islington (bot) ab5da50d82
bpo-33642 and bpo-33679: Revise and condense blurbs (GH-7500)
(cherry picked from commit bed523ba03)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-07 16:30:19 -07:00
Miss Islington (bot) 8fa398d5ce bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499)
The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.
(cherry picked from commit 79790bc35f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 00:49:34 +02:00
Miss Islington (bot) 4705ea38c9 update to Unicode 11.0.0 (closes bpo-33778) (GH-7439) (GH-7470)
Also, standardize indentation of generated tables.
(cherry picked from commit 7c69c1c0fb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-06-07 03:36:22 -04:00
Miss Islington (bot) d6e789c402
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
(cherry picked from commit e336484847)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-06-05 17:12:06 -07:00
Miss Islington (bot) 79c7e57c46 bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403) (GH-7428)
In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
(cherry picked from commit 415bc46a78)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-05 10:18:20 -04:00
Miss Islington (bot) 631fe1fa42
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976057)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-05 06:21:04 -07:00
Miss Islington (bot) 103058e19b
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
(cherry picked from commit 2a4a62ba4a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-06-04 13:41:49 -07:00
Miss Islington (bot) 150033d159
bpo-31849: Fix warning in pyhash.c (GH-6799)
(cherry picked from commit a8eb58546b)

Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
2018-06-04 10:31:07 -07:00
Miss Islington (bot) b7eb1024d0
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
(cherry picked from commit b609e687a0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:33:23 -07:00
Miss Islington (bot) 87936d03cb bpo-33734: asyncio/ssl: a bunch of bugfixes (GH-7321) (GH-7396)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)

* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
(cherry picked from commit 9602643120)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-04 12:05:46 -04:00
Miss Islington (bot) cfc12ec68c
bpo-33664: Scroll IDLE editor text by lines (GH-7351)
Previously, the mouse wheel and scrollbar slider moved text by a fixed
number of pixels, resulting in partial lines at the top of the editor
box. The change also applies to the shell and grep output windows,
but not to read-only text views.
(cherry picked from commit d49dbd9acc)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:05:24 -07:00
Miss Islington (bot) 4e033c5aa1
bpo-33679: IDLE: Re-enable color configuration for code context (GH-7199)
The difference from before is that the settings are now on the
Highlights tab instead of the Extensions tab and only change one theme
at a time instead of all themes. The default for light themes is black
on light gray, as before. The default for the IDLE Dark theme is white
on dark gray, which better fits the dark theme.

When one starts IDLE from a console and loads a custom theme without
definitions for 'context', one will see a warning message on the console.
To stop the warning, go to Options => Configure IDLE => Highlights,
select the custom theme if not selected already, select 'Code Context',
and select foreground and background colors.
(cherry picked from commit de6516264e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 19:16:04 -07:00
Miss Islington (bot) 0800b6c17a
bpo-33642: IDLE: Use variable number of lines in CodeContext. (GH-7106)
Instead of displaying a fixed number of lines, some blank, Code Context
now displays the variable number of actual context lines.  When there
are no context lines, it shows a single blank line to indicate that the
feature is turned on.

The Code Context configuration option is changed from 'numlines'
(default 3) to 'maxlines' (default 15) to avoid possible interference
between user settings for the old and new versions of Code Context.
(cherry picked from commit 29996a1c4e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 16:45:54 -07:00
Miss Islington (bot) 623b439abe bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146) (GH-7306)
(cherry picked from commit e905c84494)

Co-authored-by: pkerling <pkerling@casix.org>
2018-06-01 12:50:24 +02:00