Commit Graph

21082 Commits

Author SHA1 Message Date
Miss Islington (bot) 51b2f6d3a3 bpo-33503: Fix the broken pypi link in the source and the documentation (GH-6814) (GH-6872)
(cherry picked from commit 19177fbd5d)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-05-16 10:05:46 -04:00
Miss Islington (bot) c73268aad7
bpo-33453: Handle string type annotations in dataclasses. (GH-6768)
(cherry picked from commit 2a7bacbd91)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-15 21:22:13 -07:00
Miss Islington (bot) 820219f786
bpo-33509: Fix _warnings for module_globals=None (GH-6833)
Don't crash on warnings.warn_explicit() if module_globals is not a dict.
(cherry picked from commit b056562860)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-15 13:56:28 -07:00
Miss Islington (bot) f4fdb619dd bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669) (GH-6862)
Also bump PendingDeprecationWarning to DeprecationWarning.
(cherry picked from commit 9eb40bc38d)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-05-15 13:30:06 -04:00
Eric Snow 6bd0c476c5
bpo-32604: Remove xid registry. (#6813)
Remove the interpreters testing helper (and xid registry).
2018-05-15 09:56:18 -04:00
Miss Islington (bot) 2ce72e243f
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
(cherry picked from commit 735abadd5b)

Co-authored-by: Segev Finer <segev208@gmail.com>
2018-05-14 22:40:27 -07:00
Miss Islington (bot) cc598ae264
Add AsyncContextManager to typing module documentation. (GH-6822)
(cherry picked from commit b7b493e2fb)

Co-authored-by: Travis DePrato <773453+travigd@users.noreply.github.com>
2018-05-14 18:10:47 -07:00
Miss Islington (bot) 5195039bb5 bpo-33497: Add NEWS and ACKS entries. (GH-6838) (GH-6840)
(cherry picked from commit d063b84d9e)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-14 18:21:10 -04:00
Pablo Galindo 8e633a4035 bpo-20104: Remove posix_spawn from 3.7 (GH-6794)
Remove os.posix_spawn, the API isn't complete and we're still figuring out how it should look. wait for 3.8.
2018-05-14 17:52:43 -04:00
Miss Islington (bot) c3fa1f2b93 [3.7] bpo-32861: urllib.robotparser fix incomplete __str__ methods. (GH-5711) (GH-6795)
The urllib.robotparser's __str__ representation now includes wildcard
entries and the "Crawl-delay" and "Request-rate" fields.
(cherry picked from commit bd08a0af2d)

Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>
2018-05-14 21:14:30 +03:00
Miss Islington (bot) ceb45f0df8
bpo-33494: Change dataclasses.Fields repr to use the repr of each of its members (GH-6798)
(cherry picked from commit 2473eea65d)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-14 10:31:10 -07:00
Miss Islington (bot) 8ed545f6de
bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123)
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.

https://bugs.gentoo.org/show_bug.cgi?id=636400
(cherry picked from commit 1e2ec8a996)

Co-authored-by: Rolf Eike Beer <eike@sf-mail.de>
2018-05-13 04:17:07 -07:00
Miss Islington (bot) 3c28a6387b
bpo-28556: Minor fixes for typing module (GH-6732)
This also fixes https://bugs.python.org/issue33420
(cherry picked from commit 43d12a6bd8)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-08 18:44:09 -07:00
Miss Islington (bot) 6049bda21b [3.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. (GH-6708) (GH-6713)
(cherry picked from commit cedc9b7420)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-06 10:20:12 +03:00
Miss Islington (bot) 351782b992
bpo-33422: Fix quotation marks getting deleted when looking up byte/string literals on pydoc. (GH-6701)
Also update the list of string prefixes.
(cherry picked from commit b2043bbe60)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-05-05 09:42:56 -07:00
Miss Islington (bot) 6a56790e0b
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
(cherry picked from commit 491bbedc20)

Co-authored-by: lekma <lekmalek@gmail.com>
2018-05-02 02:50:48 -07:00
Ned Deily eb96c37699 3.7.0b4 2018-05-02 03:41:45 -04:00
Miss Islington (bot) 3c5d3f519d Enable the verbose build for extension modules with GNU make (GH-6659) (#6662)
(cherry picked from commit 10f715d712)

Co-authored-by: Matthias Klose <doko42@users.noreply.github.com>
2018-05-02 08:57:24 +02:00
Miss Islington (bot) 9da7ee4003 bpo-33393: Update config.guess and config.sub files (GH-6658) (#6661)
(cherry picked from commit 7e3545c70c)

Co-authored-by: Matthias Klose <doko42@users.noreply.github.com>
2018-05-02 08:54:51 +02:00
Miss Islington (bot) d74f35331f bpo-33281: NEWS and ACK (GH-6681) (GH-6682)
(cherry picked from commit 69a013ec18)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-01 22:52:42 -04:00
Miss Islington (bot) 0596f31902 bpo-33377: add triplets for mips-r6 and riscv (GH-6655) (GH-6660)
(cherry picked from commit ddbe976964)

Co-authored-by: Matthias Klose <doko42@users.noreply.github.com>
2018-05-01 10:40:17 -04:00
Miss Islington (bot) 77fa7835da
bpo-20104: Improve error handling and fix a reference leak in os.posix_spawn(). (GH-6332)
(cherry picked from commit ef347535f2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-01 07:18:44 -07:00
Miss Islington (bot) e4eeb6eff1
bpo-31908: Fix output of cover files for trace module command-line tool. (GH-4205)
Previously emitted cover files only when --missing option was used.
(cherry picked from commit 47ab15470d)

Co-authored-by: Michael Selik <mike@selik.org>
2018-04-30 21:06:00 -07:00
Miss Islington (bot) 2e5fa38c5a
bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467)
(cherry picked from commit 3ab9365dca)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
2018-04-30 12:30:26 -07:00
Miss Islington (bot) 887b5f8fc6
bpo-21474: Update IDLE word/identifier definition from ascii to unicode. (GH-6643)
In text and entry boxes, this affects selection by double-click,
movement left/right by control-left/right, and deletion left/right
by control-BACKSPACE/DEL.
(cherry picked from commit 5ff3a161c8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-30 00:27:50 -07:00
Miss Islington (bot) 736f17fb8d
bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442)
(cherry picked from commit 7d68bfa826)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-04-29 12:10:12 -07:00
Miss Islington (bot) ee95feb69d [3.7] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630) (GH-6631)
(cherry picked from commit 2e38cc3933)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-29 14:50:26 +03:00
Miss Islington (bot) 1487c37e7e
bpo-33378: Add Korean to the language switcher. (GH-6627)
(cherry picked from commit 5779483299)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-04-28 13:23:45 -07:00
Zsolt Dollenstein a93a663d6c [3.7] bpo-33363: raise SyntaxError for async for/with outside async functions (GH-6616). (GH-6619) 2018-04-27 18:33:37 -04:00
Miss Islington (bot) dd3ede7537
bpo-33358: Fix test_embed.test_pre_initialization_sys_options (GH-6612)
Fix test_embed.test_pre_initialization_sys_options() when building with --enable-shared
(cherry picked from commit 4114846265)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-04-27 05:41:25 -07:00
Miss Islington (bot) 52a5a17338
bpo-33128 Fix duplicated call to importlib._install_external_importers (GH-6273)
External importers were being added in both phases of the import
system initialisation.

They're only supposed to be added in the second phase, after the
import machinery has been appropriately configured.
(cherry picked from commit 0977091dca)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-04-24 19:48:04 -07:00
Miss Islington (bot) 75a3e3d5bc bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (GH-6579)
Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
reserved signal numbers between 1 and NSIG.  The `range(1, NSIG)` idiom
is commonly used to select all signals for blocking with `pthread_sigmask`.
So we ignore the sigaddset() return value until we expose sigfillset()
to provide a better idiom.
(cherry picked from commit 25038ecfb6)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-04-23 21:42:26 +02:00
Miss Islington (bot) 9fc998d761 bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555)
(cherry picked from commit d5a2377c3d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-04-23 03:58:23 +03:00
Miss Islington (bot) 3e0d23cd43
Clarify that __path__ can't be just any value (GH-6554)
(cherry picked from commit 441d945eb3)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
2018-04-20 16:45:14 -07:00
Miss Islington (bot) b221107d32
bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)
Upgrade ensurepip to bundle pip 10.0.1
(cherry picked from commit 0399cf9b5e)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2018-04-20 13:47:44 -07:00
Miss Islington (bot) 392520bd78 bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543)
Fix clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by
adjusting how the internal struct _dictkeysobject shared keys structure is
declared.

This remains ABI compatible.  We get rid of the union at the end of the
struct being used for conveinence to avoid typecasting in favor of char[]
variable length array at the end of a struct. This is known to clang to be
used for variable sized objects and will not cause an undefined behavior
problem.  Similarly, char arrays do not have strict aliasing undefined
behavior when cast.

PEP-007 does not currently list variable length arrays (VLAs) as allowed
in our subset of C99.  If this turns out to be a problem, the fix to this is
to change the char `dk_indices[]` into `dk_indices[1]` and restore the
three size computation subtractions this change removes:
  `- Py_MEMBER_SIZE(PyDictKeysObject, dk_indices)`

If this works as is I'll make a separate PR to update PEP-007.
(cherry picked from commit 397f1b28c4)
2018-04-20 10:06:21 -07:00
Miss Islington (bot) 18cd82815b
bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489)
Setup modules are no longer built with -DPy_BUILD_CORE by default,
as using that flag may now require including additional internal-only header files.

Instead, only the modules that specifically need it use that setting.
(cherry picked from commit 063db62aab)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2018-04-20 08:39:18 -07:00
Miss Islington (bot) a4fb580f70
bpo-33189: pygettext.py now accepts only literal strings (GH-6364)
as docstrings and translatable strings, and rejects
bytes literals and f-string expressions.
(cherry picked from commit 69524821a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-18 23:49:15 -07:00
Miss Islington (bot) b27c71cdc0
bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)
Converting with line_info=False and col_info=True crashed before.
(cherry picked from commit e5362eaa75)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-18 22:10:36 -07:00
Miss Islington (bot) 67067d85eb bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528)
(cherry picked from commit e3a523a0fa)

Co-authored-by: Denis Osipov <osipov_d@list.ru>
2018-04-18 17:15:09 -07:00
Miss Islington (bot) 3b3be1fe10
bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)
(cherry picked from commit c127a86e18)

Co-authored-by: Aaron Ang <aaronang@users.noreply.github.com>
2018-04-17 14:58:34 -07:00
Miss Islington (bot) 902bb62d5a
bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350)
(cherry picked from commit 5fbc511f56)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-17 10:17:19 -07:00
Miss Islington (bot) 237148ecc0 acks += Zsolt Dollenstein (GH-6490) (GH-6492)
(cherry picked from commit 2bea947628)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-04-16 17:26:25 -07:00
Miss Islington (bot) 986eaa86da
bpo-33185: Improve wording and markup (GH-6477)
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)
(cherry picked from commit 1a5c4bdb6e)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-04-15 06:55:10 -07:00
Miss Islington (bot) d7ffa58207
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)
The pydoc CLI assumed -m pydoc would add the empty string
to sys.path, and hence got confused when it switched to
adding the full initial working directory instead.

This refactors the pydoc CLI path manipulation to be
more testable, and ensures it won't accidentally
remove the standard library directory containing
pydoc itself from sys.path.
(cherry picked from commit 82a9481059)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-04-15 05:17:13 -07:00
Miss Islington (bot) df958ff28a
bpo-33184: Update Windows installer to OpenSSL 1.1.0h (GH-6463)
(cherry picked from commit b1dc07509f)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-04-13 17:52:02 -07:00
Ethan Furman 3715176557
[3.7] bpo-33217: deprecate non-Enum lookups in Enums (GH-6392)
deprecate non-Enum lookups in Enums

Lookups such as `1 in Color` and `2 in SomeFlag()` will raise TypeError
in 3.8+.
2018-04-11 18:56:25 -07:00
Miss Islington (bot) b26265900a bpo-33097: Fix submit accepting callable after executor shutdown by interpreter exit (GH-6144) (GH-6445)
Executors in concurrent.futures accepted tasks after executor was shutdown by interpreter exit. Tasks were left in PENDING state forever. This fix changes submit to instead raise a RuntimeError.
(cherry picked from commit c4b695f85e)

Co-authored-by: Mark Nemec <mrknmc@me.com>
2018-04-10 20:35:02 +02:00
Miss Islington (bot) 9b25bd6e26
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259)
Based on patch by Oleg Krasnikov.
(cherry picked from commit c93938b5be)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-09 10:57:52 -07:00
Miss Islington (bot) 31f1b52f1f bpo-33201: Modernize "Extension types" doc (GH-6337) (GH-6411)
* bpo-33201: Modernize "Extension types" doc
* Split tutorial and other topics
* Some small fixes
* Address some review comments
* Rename noddy* to custom* and shoddy to sublist
* Fix markup
(cherry picked from commit 1d80a56173)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-04-07 18:27:05 +02:00
Miss Islington (bot) 12d1dcd1f8 bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. (GH-6407) (GH-6409)
(cherry picked from commit b405752dab)

Co-authored-by: Ned Deily <nad@python.org>
2018-04-07 03:02:40 -04:00
Miss Islington (bot) 98e8ac8d82 [3.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6404)
(cherry picked from commit ef5ce884a4)

Co-authored-by: Jay Crotts <crotts.jay@gmail.com>
2018-04-06 22:00:06 -04:00
Brett Cannon a09bb87c1e
[3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402) (GH-6403)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
(cherry picked from commit 9e2be60634)
2018-04-06 17:02:18 -07:00
Miss Islington (bot) 3c193cf8af [3.7] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6399)
(cherry picked from commit 3a9ccee0e5)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-04-06 18:14:29 -04:00
Miss Islington (bot) 64421d9237
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
(cherry picked from commit 0c1c4563a6)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-06 00:12:38 -07:00
Miss Islington (bot) 28c179094b bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6390) 2018-04-05 11:45:33 -07:00
Miss Islington (bot) baf304e82e bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6387)
(cherry picked from commit 091e95e900)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
2018-04-05 09:02:12 -07:00
Miss Islington (bot) fcd4e03e08
bpo-29922: Improve error messages in 'async with' (GH-6352)
when __aenter__() or __aexit__() return non-awaitable object.
(cherry picked from commit a68f2f0578)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-04 07:09:00 -07:00
Miss Islington (bot) b8fc2d6580
bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329)
Py_UNICODE is deprecated since Python 3.3.
But the deprecation is missed in the c-api/arg document.
(cherry picked from commit 42ec190761)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-03 22:13:38 -07:00
Miss Islington (bot) 9216dffbc8
bpo-32337: Update documentats about dict order (GH-4973)
(cherry picked from commit dfbbbf16f9)

Co-authored-by: hui shang <shangdahao@gmail.com>
2018-04-03 22:01:46 -07:00
Miss Islington (bot) 74735e2a40 bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6366)
(cherry picked from commit c869529ea9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-03 14:35:11 -07:00
Miss Islington (bot) de755129a7
bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341)
(cherry picked from commit d1c82c5cc7)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-02 20:00:26 -07:00
Miss Islington (bot) fa91aff07c
bpo-33204: IDLE - revise and extend colorizer test. (GH-6347)
Followup to primary PR for the issue, GH-6344.
(cherry picked from commit 55966f3a0d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-02 09:03:52 -07:00
Miss Islington (bot) 6130675efe
bpo-33204: IDLE: consistently color invalid string prefixes (GH-6344)
A 'u' string prefix cannot be paired with either 'r' or 'f'.  Consistently
color as much of the prefix, starting at the right, as is valid.
(cherry picked from commit da58533ac6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-01 23:09:18 -07:00
Miss Islington (bot) 2961717986 bpo-33182: Fix pointer types in _testembed (GH-6310) (GH-6311)
(cherry picked from commit 69f5c73311)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-03-30 16:24:03 +10:00
Miss Islington (bot) faa6f5c74c
bpo-33175: dataclasses should look up __set_name__ on class, not instance (GH-6305)
(cherry picked from commit 521995205a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-29 08:32:36 -07:00
Ned Deily 4e7efa9c6f 3.7.0b3 2018-03-29 07:57:55 -04:00
Ned Deily 7a6f59e123
bpo-32726: macOS 10.6+ installer now builds Tcl/TK 8.6 (GH-6308)
Build and link with private copy of Tcl/Tk 8.6 for the macOS 10.6+
installer. The 10.9+ installer variant already does this.  This means that
the Python 3.7 provided by the python.org macOS installers no longer need or
use any external versions of Tcl/Tk, either system-provided or user-
installed, such as ActiveTcl.
2018-03-29 07:41:11 -04:00
Miss Islington (bot) a48614bee5 FIX documentation and NEWS of ThreadedHTTPServer. (GH-6207) (GH-6302)
(cherry picked from commit 79c3bab35c)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-03-29 04:33:47 -04:00
Serhiy Storchaka fd93666c8a
[3.7] Fix duplicating words words. (GH-6296) (GH-6297)
Most of them have been added in 3.7.
(cherry picked from commit bac2d5ba30)
2018-03-28 23:05:24 +03:00
Miss Islington (bot) 6124d8ec0d bpo-33126: Document PyBuffer_ToContiguous() (GH-6292) (GH-6294)
(cherry picked from commit aa50bf08e6)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-03-28 17:50:24 +02:00
Miss Islington (bot) 6cb556ffa6
s/the the/the/ (GH-6287)
(cherry picked from commit 40a536be53)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-28 06:23:32 -07:00
Miss Islington (bot) b9172b9630 [3.7] bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. (GH-6283)
(cherry picked from commit c0518cde7a)

Co-authored-by: Ned Deily <nad@python.org>
2018-03-28 04:49:24 -04:00
Miss Islington (bot) d2d5bd8bc4 bpo-32872: Avoid regrtest compatibility issue with namespace packages. (GH-6276) (#6277)
(cherry picked from commit e52ac04597)

Co-authored-by: Ned Deily <nad@python.org>
2018-03-28 02:39:19 -04:00
Miss Islington (bot) f328caf4ca bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195) (#GH-6266)
(cherry picked from commit da1734c58d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-26 19:23:34 -07:00
Miss Islington (bot) d0e04c8244
bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216)
This also fixes python/typingGH-512
This also fixes python/typingGH-511

As was discussed in both issues, some typing forms deserve to be treated
as immutable by copy and pickle modules, so that:
* copy(X) is X
* deepcopy(X) is X
* loads(dumps(X)) is X  GH- pickled by reference

This PR adds such behaviour to:
* Type variables
* Special forms like Union, Any, ClassVar
* Unsubscripted generic aliases to containers like List, Mapping, Iterable

This not only resolves inconsistencies mentioned in the issues, but also
improves backwards compatibility with previous versions of Python
(including 3.6).

Note that this requires some dances with __module__ for type variables
(similar to NamedTuple) because the class TypeVar itself is define in typing,
while type variables should get module where they were defined.

https://bugs.python.org/issue32873
(cherry picked from commit 834940375a)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-03-26 15:29:06 -07:00
Miss Islington (bot) 05455637f3
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-26 13:14:09 -07:00
Miss Islington (bot) c6147acd2c
bpo-33141: Have dataclasses.Field pass through __set_name__ to any default argument. (GH-6260)
This is part of PEP 487 and the descriptor protocol.
(cherry picked from commit de7a2f04d6)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-26 10:55:13 -07:00
Miss Islington (bot) a7b1b847f6
bpo-33096: Fix ttk.Treeview.insert. (GH-6228)
Allow ttk.Treeview.insert to insert iid that has a false boolean value.
Note iid=0 and iid=False would be same.
(cherry picked from commit 3ab44c0783)

Co-authored-by: Garvit Khatri <garvitdelhi@gmail.com>
2018-03-26 01:19:52 -07:00
Nick Coghlan ee3784594b
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.

This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.

(cherry picked from commit d5d9e02dd3)
2018-03-25 23:43:50 +10:00
Miss Islington (bot) 2dd885eaa0 [3.7] bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229) (GH-6230)
Harden ssl module against LibreSSL CVE-2018-8970.
X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test
ensures that NULL bytes are not allowed.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-25 13:28:20 +02:00
Miss Islington (bot) c6d94c37f4
bpo-33042: Fix pre-initialization sys module configuration (GH-6157)
- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
  called before Py_Initialize
- also enhanced the existing embedding test cases
  to check for expected settings in the sys module
(cherry picked from commit bc77eff8b9)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-03-25 04:27:57 -07:00
Miss Islington (bot) 9989efbb65
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)
* Change _hash_action to be a function table lookup, instead of a list
of strings which is then tested with if statements.
(cherry picked from commit 01d618c560)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-24 19:31:29 -07:00
Miss Islington (bot) 42bd62bc87 [3.7] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6213)
LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.

Documentation updates and fixes for failing tests will be provided in
another patch set.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-24 18:37:54 +01:00
Ivan Levkivskyi ac5602746e
bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) (#6162) 2018-03-23 21:44:54 +00:00
Miss Islington (bot) 45738ede5a
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC (GH-6061)
(cherry picked from commit 5cbb84106e)

Co-authored-by: Himanshu Lakhara <himanshulakhara1947@gmail.com>
2018-03-23 14:41:26 -07:00
Miss Islington (bot) f8d2c3cf5f
bpo-31639: Use threads in http.server module. (GH-5018)
(cherry picked from commit 8bcfa02e4b)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-03-23 13:31:20 -07:00
Serhiy Storchaka b9744e924c
bpo-33041: Fixed jumping if the function contains an "async for" loop. (GH-6154) 2018-03-23 14:35:33 +02:00
Miss Islington (bot) 3b4c6b16c5
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192)
If a dataclass has a member variable that's of type Field, but it doesn't have a type annotation, raise TypeError.
(cherry picked from commit 56970b8ce9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-22 13:58:59 -07:00
Miss Islington (bot) 346964ba05
bpo-33018: Improve issubclass() error checking and message. (GH-5944)
This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
(cherry picked from commit 40472dd42d)

Co-authored-by: jab <jab@users.noreply.github.com>
2018-03-22 04:49:26 -07:00
Miss Islington (bot) 4ddc99d159 bpo-33116: Add 'Field' to dataclasses.__all__. (GH-6182) (GH-6183)
- Add missing 'Field' to __all__.
- Improve tests to catch this.
(cherry picked from commit 8e4560a9da)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-21 17:44:23 -04:00
Miss Islington (bot) f5625d58fa FIX failure on OSX sem_getvalue (GH-6180) (GH-6181)
(cherry picked from commit dec1c7786f)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-21 20:00:55 +01:00
Miss Islington (bot) bb5b529197 bpo-33078 - Fix queue size on pickling error (GH-6119) (GH-6178)
(cherry picked from commit e2f33add63)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-21 17:21:15 +01:00
Miss Islington (bot) 22136c94b6 bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170) (GH-6171)
Fix the way that new annotations in a class are detected.
(cherry picked from commit 8f6eccdc64)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-21 05:17:30 -04:00
Miss Islington (bot) 3326c9267f
bpo-27683: Fix a regression for host() of ipaddress network objects (GH-6016)
The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.
(cherry picked from commit 10b134a07c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-20 18:22:23 -07:00
Miss Islington (bot) a323eee4c4
bpo-18802: Add more details to ipaddress documentation (GH-6083)
Original patch by Jon Foster and Berker Peksag.
(cherry picked from commit 5609b78392)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-20 17:30:43 -07:00
Miss Islington (bot) a70b8f5936
bpo-28247: Document Windows executable creation in zipapp (GH-6158)
(cherry picked from commit 4be79f2946)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-20 15:44:21 -07:00
Miss Islington (bot) 56cce1ca84 [3.7] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6159)
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9)

Co-authored-by: Nir Soffer <nirsof@gmail.com>
2018-03-20 20:16:30 +01:00
Miss Islington (bot) 3d41f48259 bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152) (GH-6153)
If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.
(cherry picked from commit 7389fd935c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-19 21:31:22 -04:00
Miss Islington (bot) 45648312e5 bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (GH-6147) (GH-6148)
If a non-dataclass derives from a frozen dataclass, allow attributes to be set.
Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen.
Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.
(cherry picked from commit f199bc655e)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-18 21:03:36 -04:00
Miss Islington (bot) 3c0a5a7c7b
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
(cherry picked from commit 134cb01cda)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-18 13:50:41 -07:00
Miss Islington (bot) fdd8e8b4ff
bpo-19417: Add test_bdb.py (GH-5217)
(cherry picked from commit 3fe33043ee)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2018-03-18 13:25:15 -07:00
Miss Islington (bot) 136905fffd
bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-03-16 23:03:56 -07:00
Miss Islington (bot) 6e65e44626 [3.7] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) (#6103)
Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c29e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2018-03-14 18:52:28 +01:00
Miss Islington (bot) f216cbf9ab bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (GH-6084) (#6092)
(cherry picked from commit 095ee415ce)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-13 10:10:57 +01:00
xdegaye e32bbaf376 [3.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-5928) 2018-03-13 10:52:35 +02:00
Miss Islington (bot) b4c8871ca4 bpo-33064: lib2to3: support trailing comma after *args and **kwargs (GH-6096) (#6097)
New tests also added.

I also made the comments in line with the builtin Grammar/Grammar. PEP 306 was
withdrawn, Kees Blom's railroad program has been lost to the sands of time for
at least 16 years now (I found a python-dev post from people looking for it).
(cherry picked from commit b51f5de711)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 01:08:02 -07:00
Miss Islington (bot) ff5d21331e bpo-31804: Fix multiprocessing.Process with broken standard streams (GH-6079) (GH-6080)
In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows).  Avoid failing with a non-0 exit code in those conditions.

Report and initial patch by poxthegreat.
(cherry picked from commit e756f66c83)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-03-11 19:42:37 +01:00
Serhiy Storchaka 04aadf23ea
[3.7] bpo-33026: Fix jumping out of "with" block by setting f_lineno. (GH-6026). (#6074)
(cherry picked from commit 26c9f565d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-11 09:30:13 +02:00
Miss Islington (bot) 5506d60302
bpo-32836: Remove obsolete code from symtable pass (GH-5680)
When comprehensions switched to using a nested scope, the old
code for generating a temporary name to hold the accumulation
target became redundant, but was never actually removed.

Patch by Nitish Chandra.
(cherry picked from commit 3a087beddd)

Co-authored-by: Nitish Chandra <nitishchandrachinta@gmail.com>
2018-03-10 15:11:47 -08:00
Miss Islington (bot) e8a5a92037 bpo-27645: Add support for native backup facility of SQLite (GH-4238)
(cherry picked from commit d7aed4102d)

Co-authored-by: Emanuele Gaifas <lelegaifax@gmail.com>
2018-03-11 01:29:19 +03:00
Miss Islington (bot) bf0d116517 bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044) (GH-6057)
* Skip write()/data_received() if sslpipe is destroyed
(cherry picked from commit 5e80a71ab6)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-03-10 18:27:01 +02:00
Miss Islington (bot) 3c39beb65d
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
(cherry picked from commit 12f74d8608)

Co-authored-by: Nathan Henrie <n8henrie@users.noreply.github.com>
2018-03-09 10:14:14 -08:00
Miss Islington (bot) 8c163bbf37
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6010)
(cherry picked from commit 3b20d3454e)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-08 08:26:43 -08:00
Miss Islington (bot) d824b4e4af
bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)
(cherry picked from commit fc7df0e664)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-06 23:47:40 -08:00
Miss Islington (bot) c4d77a6611
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
(cherry picked from commit bc3f2289b9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-06 21:26:19 -08:00
Miss Islington (bot) 112f799666
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bd)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-03-06 10:23:48 -08:00
Miss Islington (bot) 31e2b76f7b
bpo-33005: Fix _PyGILState_Reinit() (GH-6001)
Fix a crash on fork when using a custom memory allocator (ex: using
PYTHONMALLOC env var).

_PyGILState_Reinit() and _PyInterpreterState_Enable() now use the
default RAW memory allocator to allocate a new interpreters mutex on
fork.
(cherry picked from commit 5d92647102)

Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
2018-03-06 05:52:27 -08:00
Miss Islington (bot) 96fdbacb77
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
(cherry picked from commit 6921e73e33)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-03-05 15:12:56 -08:00
Miss Islington (bot) fd340bf9e3
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-03-05 08:49:15 -08:00
Miss Islington (bot) a5303dd9c2
bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701)
(cherry picked from commit 74382a3f17)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-04 04:00:33 -08:00
Miss Islington (bot) 0902a2d6b2 bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Jamie Davis <davisjam@vt.edu>
(cherry picked from commit 0e6c8ee235)
2018-03-03 21:55:07 -08:00
Miss Islington (bot) 6ae75d9d12 bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5945)
(cherry picked from commit 3e197c7a67)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-01 18:28:41 +08:00
Miss Islington (bot) 7e5763469e
bpo-32940: IDLE: Simplify StringTranslatePseudoMapping in pyparse (GH-5862)
The new code also runs faster.
(cherry picked from commit f0daa880a4)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-28 15:08:21 -08:00
Ned Deily b0ef5c979b Update NEWS, docs, and patchlevel for 3.7.0b2 2018-02-27 19:49:18 -05:00
Miss Islington (bot) b7dcae358e Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" (GH-5912) (GH-5931)
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)"

This reverts commit dd42cb71f2.
(cherry picked from commit be50a7b627)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-27 18:30:30 -05:00
Ned Deily a7edca7122 bpo-32901: update macOS 10.9+ installer to Tcl/Tk 8.6.8 2018-02-27 17:43:53 -05:00
Miss Islington (bot) 4c842b0920
bpo-31453: Add setter for min/max protocol version (GH-5259)
OpenSSL 1.1 has introduced a new API to set the minimum and maximum
supported protocol version. The API is easier to use than the old
OP_NO_TLS1 option flags, too.

Since OpenSSL has no call to set minimum version to highest supported,
the implementation emulate maximum_version = MINIMUM_SUPPORTED and
minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and
maximum supported version at compile time.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 03:41:04 -08:00
Christian Heimes 89c2051a55
[3.7] bpo-32951: Disable SSLSocket/SSLObject constructor (GH-5864) (#5925)
Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 11:17:32 +01:00
Miss Islington (bot) 102d5204ad
bpo-28124: deprecate ssl.wrap_socket() (GH-5888)
The ssl module function ssl.wrap_socket() has been de-emphasized
and deprecated in favor of the more secure and efficient
SSLContext.wrap_socket() method.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 01:45:31 -08:00
Miss Islington (bot) 2614ed4c6e
bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (GH-5663)
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes

Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and
TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2. Other tests currently
fail because the threaded or async test servers stop after failure.

I'm going to address these issues when OpenSSL 1.1.1 reaches beta.

OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 00:17:49 -08:00
Miss Islington (bot) a93e3dc236 bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen classes and vice-versa, (GH-5919) (GH-5920)
This restriction will be relaxed at a future date.
(cherry picked from commit 2fa6b9eae0)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-26 20:59:55 -05:00
Miss Islington (bot) a9a8a9814a
bpo-32713: Fix tarfile.itn for large/negative float values. (GH-5434)
(cherry picked from commit 72d9b2be36)

Co-authored-by: Joffrey F <f.joffrey@gmail.com>
2018-02-26 16:50:09 -08:00
Miss Islington (bot) 51d95ffc2f
bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints (GH-4745)
(cherry picked from commit eee72d4778)

Co-authored-by: Tobotimus <Tobotimus@users.noreply.github.com>
2018-02-26 15:23:26 -08:00
Miss Islington (bot) 53d3f8a899
bpo-32394: Remove some TCP options on old version Windows. (GH-5523)
(cherry picked from commit 19e7d48ce8)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2018-02-26 10:36:17 -08:00
Miss Islington (bot) a9e0b070b3
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
(cherry picked from commit 6f600ff173)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-26 06:25:40 -08:00
Miss Islington (bot) 4cffe2f66b bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_hash. (GH-5891) (GH-5902)
unsafe_hash=False is now the default. It is the same behavior as the old hash=None parameter. unsafe_hash=True will try to add __hash__. If it already exists, TypeError is raised.
(cherry picked from commit dbf9cff48a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-26 04:43:35 -05:00
Miss Islington (bot) 632c1cb571
bpo-32622: Native sendfile on windows (GH-5565)
* Support sendfile on Windows Proactor event loop naively.
(cherry picked from commit a19fb3c6aa)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-02-25 09:10:58 -08:00
Miss Islington (bot) 4cb373359d [3.7] bpo-32647: Link ctypes extension with libdl. (GH-5550) (#5874)
The ctypes module used to depend on indirect linking for dlopen. The shared
extension is now explicitly linked against libdl on platforms with dl.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 13:07:24 +01:00
Miss Islington (bot) ff7528f089 [3.7] bpo-31809: test secp ECDH curves (GH-4036) (#5872)
Add tests to verify connection with secp384r1 ECDH curves.
(cherry picked from commit b7b9225831)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:56:11 +01:00
Miss Islington (bot) b5655f3d18
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
The 'optimization' is for space in the executable file, not for run time.
(cherry picked from commit 186b606d8a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-24 19:24:08 -08:00
Miss Islington (bot) 01d9c23e47 [3.7] bpo-30622: Improve NPN support detection (GH-5859) (#5860)
The ssl module now detects missing NPN support in LibreSSL.

Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org>
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 6cdb7954b0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-24 23:04:27 +01:00
Miss Islington (bot) 8fa8478dde [3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (#5857)
* The SSLSocket is no longer implemented on top of SSLObject to
  avoid an extra level of indirection.
* Owner and session are now handled in the internal constructor.
* _ssl._SSLSocket now uses the same method names as SSLSocket and
  SSLObject.
* Channel binding type check is now handled in C code. Channel binding
  is always available.

The patch also changes the signature of SSLObject.__init__(). In my
opinion it's fine. A SSLObject is not a user-constructable object.
SSLContext.wrap_bio() is the only valid factory.
(cherry picked from commit 141c5e8c24)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-24 21:51:56 +01:00
Miss Islington (bot) e49bf0f353
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
(cherry picked from commit 42c35d9c0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-24 09:39:18 -08:00
Miss Islington (bot) 46632f4d3c [3.7] bpo-32819: Simplify and improve ssl.match_hostname (GH-5620) (#5847)
ssl.match_hostname() has been simplified and no longer depends on re and
ipaddress module for wildcard and IP addresses. Error reporting for invalid
wildcards has been improved.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-24 15:06:46 +01:00
Miss Islington (bot) 1c37e27719 [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128) (GH-5843)
Previously, the ssl module stored international domain names (IDNs)
as U-labels. This is problematic for a number of reasons -- for
example, it made it impossible for users to use a different version
of IDNA than the one built into Python.

After this change, we always convert to A-labels as soon as possible,
and use them for all internal processing. In particular, server_hostname
attribute is now an A-label, and on the server side there's a new
sni_callback that receives the SNI servername as an A-label rather than
a U-label.
(cherry picked from commit 11a1493bc4)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-23 19:18:28 -08:00
Miss Islington (bot) f409c9988e
bpo-32916: IDLE: Change `str` to `code` in pyparse (GH-5830)
Adjust tests and user modules to match.
(cherry picked from commit c29c03a34a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-23 18:59:53 -08:00
Miss Islington (bot) 74b7364259
bpo-32901: Update Tcl and Tk versions to 8.6.8 (GH-5823)
(cherry picked from commit efa6c76226)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-23 08:44:27 -08:00
Miss Islington (bot) 694c5e0e1f
bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup.
(cherry picked from commit 33dddac00b)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
2018-02-22 21:39:02 -08:00
Miss Islington (bot) e5a9b3574c
bpo-32457: Improves handling of denormalized executable path when launching Python (GH-5756)
(cherry picked from commit 48e8c82fc6)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-22 11:15:16 -08:00
Miss Islington (bot) 01dd52fb29
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
(cherry picked from commit 23ad6d0d1a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-22 11:02:12 -08:00
Miss Islington (bot) dfa1144582
bpo-32905: IDLE - remove unused code in pyparse module (GH-5807)
dump is similar to print but less flexible.  lastopenbracketpos is now always initialized in _study2, as was stmt_bracketing, so the class settings are not needed.  get_last_open_bracket_pos is never called.
(cherry picked from commit 451d1edaf4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-21 22:41:41 -08:00
Miss Islington (bot) bc2e110469
closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)
(cherry picked from commit 745dc65b17)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
2018-02-21 21:44:08 -08:00
Miss Islington (bot) c59bc98fb2
bpo-32874: IDLE: add tests for pyparse (GH-5755)
There are no code changes other than comments and docstrings.
(cherry picked from commit c84cf6c03f)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-21 20:09:39 -08:00
Miss Islington (bot) 69607b4ecf
bpo-32889: update valgrind suppressions (GH-5779)
Py_ADDRESS_IN_RANGE was renamed address_in_range in 3.6
(commit 3924f93794).
(cherry picked from commit ba518804bf)

Co-authored-by: Paul Price <price@astro.princeton.edu>
2018-02-20 22:27:38 -08:00
Miss Islington (bot) 1d927d4feb
bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-20 14:06:58 -08:00
Miss Islington (bot) bab4fe320a closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
os.dup2() tests for dup3() system call availability at runtime,
but doesn't remember the result across calls, repeating
the test on each call with inheritable=False.

Since the caller of os.dup2() is expected to hold the GIL,
fix this by making the variable holding the test result static.
(cherry picked from commit b3caf388a0)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-19 23:46:47 -08:00
Miss Islington (bot) a3d6c1b23b bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)
(cherry picked from commit 6240917b77)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-19 17:45:02 -08:00
Miss Islington (bot) 2072c80d06
Improve error message for "setup.py upload" without dist files (GH-21060)
(cherry picked from commit 08a6926b25)

Co-authored-by: Éric Araujo <merwok@netwok.org>
2018-02-18 19:57:17 -08:00
Miss Islington (bot) 19b7f6694a
bpo-31972: Improve docstrings for pathlib classes (GH-5310)
(cherry picked from commit dfa015cf77)

Co-authored-by: chason <chason@gmail.com>
2018-02-18 16:48:07 -08:00
Ned Deily 2e84e47626
bpo-25988: add NEWS entry for 3.7.0b2 (#5743) 2018-02-18 13:18:44 -05:00
Ivan Levkivskyi 3892899288
bpo-31333: Re-implement ABCMeta in C (GH-5733)
This adds C versions of methods used by ABCMeta that
improve performance of various ABC operations.
2018-02-18 17:39:43 +00:00
Miss Islington (bot) afb5e55836
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
(cherry picked from commit 9f4223261f)

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2018-02-16 22:53:24 -08:00
Miss Islington (bot) af6eaae306
bpo-32436: Add docs for contextvars (GH-5685)
(cherry picked from commit bd093355a6)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-02-16 09:03:18 -08:00
Miss Islington (bot) 8caee0fa57
bpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665)
(cherry picked from commit 5746510b7a)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2018-02-14 01:47:30 -08:00
Miss Islington (bot) ef20abed7f
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
(cherry picked from commit d019bc8319)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-02-13 03:32:18 -08:00
Miss Islington (bot) 9b5a90b975
bpo-32370: Use the correct encoding for ipconfig output in the uuid module. (GH-5608)
(cherry picked from commit da6c3da6c3)

Co-authored-by: Segev Finer <segev208@gmail.com>
2018-02-13 00:58:28 -08:00
Miss Islington (bot) 65c32bbe85
bpo-32837: IDLE - require encoding argument for textview.view_file. (GH-5646)
Using the system and place-dependent default encoding for open()
is a bad idea for IDLE's system and location-independent files.
(cherry picked from commit 688722cedd)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-12 15:15:01 -08:00
Miss Islington (bot) 74ebbaeb56
bpo-29248: Fix os.readlink() on Windows (GH-5577)
The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.
(cherry picked from commit 3c34aad4e7)

Co-authored-by: SSE4 <tomskside@gmail.com>
2018-02-12 13:39:42 -08:00
Miss Islington (bot) 38b4dd7f83
bpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_about. (GH-5639)
GUI test test_file_buttons() only looks at initial ascii-only lines,
but failed on systems where open() defaults to 'ascii' because
readline() internally reads and decodes far enough ahead to encounter
a non-ascii character in CREDITS.txt.
(cherry picked from commit f34e03ec0e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-12 12:34:52 -08:00
Miss Islington (bot) 0442599961 bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (GH-5449) (#5641)
(cherry picked from commit 7766b96ab8)

Co-authored-by: Коренберг Марк <socketpair@gmail.com>
2018-02-12 15:12:24 -05:00
Miss Islington (bot) a0b998df31 bpo-11015: Update test.support documentation (GH-5619)
(cherry picked from commit 988fb28431)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-12 02:34:28 +10:00
Miss Islington (bot) 170b3f7950 bpo-32792: Preserve mapping order in ChainMap() (GH-5586) (#GH-5617)
(cherry picked from commit 3793f95f98)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-02-11 01:09:52 -08:00
Miss Islington (bot) e603320975 bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609) (GH-5611)
The new link is given in a red box on the old page.
(cherry picked from commit 8d1f2f4038)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-02-10 18:08:34 -05:00
Miss Islington (bot) 2ef69a1d45 bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5602)
Co-authored-by: Jake Davis <jcdavis@awedge.net>
(cherry picked from commit 2411292ba8)
2018-02-10 00:00:48 +02:00
Miss Islington (bot) 0e361730b0 bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)
fnmatch.translate() no longer produces patterns which contain set
operations.

Sets starting with '[' or containing '--', '&&', '~~' or '||' will
be interpreted differently in regular expressions in future versions.
Currently they emit warnings. fnmatch.translate() now avoids producing
patterns containing such sets by accident.
(cherry picked from commit 23cdbfa744)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-09 13:56:50 +02:00
Miss Islington (bot) 105fcbfd6a bpo-32585: Add tkinter.ttk.Spinbox. (GH-5221) (GH-5592)
(cherry picked from commit a48e78a0b7)

Co-authored-by: Alan D Moore <me@alandmoore.com>
2018-02-09 13:40:14 +02:00
Miss Islington (bot) 2bb0bfafb0 bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (GH-5562)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process.  This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.

This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions).  `ioctl` is not a POSIX async-signal-safe approved function.

ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-05 22:31:22 -08:00
Miss Islington (bot) fea0a12f6b [3.7] bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-5543)
When `__getattr__` is implemented, attribute lookup will always fall back to that,
even if the initial failure comes from `__getattribute__` or a descriptor's `__get__`
method (including property methods).
(cherry picked from commit d1f318105b)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-05 13:16:49 +10:00
Miss Islington (bot) 5b933aa8ec bpo-32765: Update configdialog General tab create page docstring (GH-5529) (GH-5537)
Add new entries to the widget list.
(cherry picked from commit 845d86485e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-04 18:39:22 -05:00
Miss Islington (bot) 1a0239e12e [3.7] bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5510)
Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule.
(cherry picked from commit 38bfa8418f)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-02-04 18:07:16 +10:00
Barry Warsaw a23d30f64b
bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.

https://bugs.python.org/issue32303
https://bugs.python.org/issue32305
(cherry picked from commit bbbcf8693b)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-02-02 19:49:25 -05:00
Miss Islington (bot) 2b5937ec0a bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (#5501)
(cherry picked from commit 2f79c01493)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2018-02-02 18:14:38 -05:00
Miss Islington (bot) c7de1d7ca6 bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265) (#5499)
Modify RE examples in documentation to use raw strings to prevent DeprecationWarning.
Add text to REGEX HOWTO to highlight the deprecation.  Approved by Serhiy Storchaka.
(cherry picked from commit 66771422d0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-02 16:50:44 -05:00
Miss Islington (bot) 29fd9eae43 Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495 (#5496)
This reverts commit 72a0d218dc.

The reverted commit had a few issues so it was unanimously decided
to undo it. See the bpo issue for details.
(cherry picked from commit 383b32fe10)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-02-02 10:04:32 -05:00
Miss Islington (bot) 71a0b0e6e8 Implement TimerHandle.when() (GH-5473) (GH-5480)
(cherry picked from commit 3d4dbd8f01)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-02-01 21:56:03 +02:00
Miss Islington (bot) 78758f29b1 [3.7] bpo-32711: Fix warnings for Python/ast_unparse.c (GH-5426) (#5475)
* bpo-32711: Fix warnings for Python/ast_unparse.c
(cherry picked from commit 83ab995871)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-02-01 18:41:24 +01:00
Xiang Zhang 86fdad093b bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)
When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash.
2018-01-31 17:02:12 -05:00
Bernhard M. Wiedemann 57750be4ad bpo-30693: zip+tarfile: sort directory listing (#2263)
tarfile and zipfile now sort directory listing to generate tar and zip archives
in a more reproducible way.

See also https://reproducible-builds.org/docs/stable-inputs/ on that topic.
2018-01-31 17:01:55 -05:00
Stéphane Wirtel 209108bd69 bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs (#5451)
Do not pass the name field in the 'from' address in the SMTP envelope.
2018-01-31 17:01:31 -05:00
Ned Deily 9561d7f501 Update NEWS, docs, and patchlevel for 3.7.0b1 2018-01-30 18:48:26 -05:00
Ned Deily 7fdefac8e8 bpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6 2018-01-30 17:29:53 -05:00
Ned Deily 8c9bb72e8b
bpo-32726: macOS installer and framework enhancements and changes for 3.7.0 (GH-5448)
This issue covers various changes for the macOS installers provided via python.org for 3.7.0.

- Provide a provisional new installer variant for macOS 10.9 and later systems with 64-bit (x86_64) architecture only.  Apple has made it known that future versions of macOS will only fully support 64-bit executables and some other third-party software suppliers have chosen 10.9 as their oldest supported system.
 
- Support **Tcl/Tk 8.6** with the 10.9 installer variant.
 
- Upgrade **OpenSSL** to 1.1.0g and **SQLite** to 3.22.0.
 
- The compiler name used for the interpreter build and for modules built with **Distutils / pip** is now _gcc_ rather than _gcc-4.2_. And extension module builds will no longer try to force use of an old SDK if present.
2018-01-30 07:42:14 -05:00
Ned Deily 763f094b1f
bpo-28440: Don't add /Library/Python/3.x/site-packages to sys.path (#5445)
No longer add /Library/Python/3.x/site-packages, the Apple-supplied
system Python site-packages directory, to sys.path for macOS framework
builds in case Apple ships a version of Python 3. A similar change
was made earlier to Python 2.7 where it was found that the coupling
between the system Python and a user-installed framework Python often
caused confusion or pip install failures.
2018-01-30 05:14:09 -05:00
Stéphane Wirtel 67adb31a41 bpo-32724: Fix references to commands in Doc/pdb.rst (GH-5444)
Some commands are specified in the documentation, but there is no direct
references.
2018-01-30 11:34:33 +02:00
John Jolly 066df4fd45 bpo-22908: Add seek and tell functionality to ZipExtFile (GH-4966)
This allows for nested zip files, tar files within zip files, zip files within tar files, etc.

Contributed by: John Jolly
2018-01-30 00:51:35 -08:00
Anders Lorentsen dd42cb71f2 bpo-31961: subprocess now accepts path-like args (GH-4329)
Allow os.PathLike args in subprocess APIs.
2018-01-29 23:27:28 -08:00
Bo Bayles ce0f33d045 bpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)
Add "capture_output=True" option to subprocess.run, this is equivalent to
setting stdout=PIPE, stderr=PIPE but is much more readable.
2018-01-29 22:40:39 -08:00
Benjamin Peterson 95441809ef
closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441) 2018-01-29 22:14:17 -08:00
Stéphane Wirtel 3d86e484de bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 (GH-5346)
See https://bugs.python.org/issue32441 for where this was introduced.
2018-01-29 22:04:36 -08:00