Commit Graph

42837 Commits

Author SHA1 Message Date
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) a90df5085b
Revert "bpo-30406: Make async and await proper keywords (GH-1669)" (GH-6143)
This reverts commit ac317700ce.

(Reverts only the lib2to3 part.)
(cherry picked from commit f64aae46da)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2018-03-18 12:15:52 -07:00
Serhiy Storchaka 773573e9ac
[3.7] bpo-33041: Add tests for jumps in/out of 'async with' blocks. (GH-6110). (GH-6140)
(cherry picked from commit bc300ce205)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-18 12:31:37 +02:00
Miss Islington (bot) 429ca448d2 bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
It was actually fixed in SQLite 3.8.8, not 3.8.7.

(cherry picked from commit bbf7bb7a63)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2018-03-18 09:24:33 +03:00
Miss Islington (bot) d7b8103741 Update pip to 9.0.2 and setuptools to 38.6.1 (GH-6133) (#6134)
(cherry picked from commit 7f81bb2add)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-17 11:46:05 -04: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) 7d0528dd3f lib2to3: Add more tests (GH-6101) (#6108)
(cherry picked from commit 74f56878cd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 11:20:38 -07: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) 39441fce02
bpo-32338: OrderedDict import is no longer needed in re. (GH-4891)
(cherry picked from commit b931bd0a2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-10 23:01:58 -08:00
Miss Islington (bot) c546a62c4d bpo-27645: Skip test_bad_target_in_transaction if SQLite == 3.8.7.1 (GH-6067)
(cherry picked from commit 7280a4eef5)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-03-11 03:59:11 +03: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) 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) 5a0c3987ab bpo-32991: Restore expectation that inspect.getfile raises TypeError on namespace package (GH-5980) (GH-5997)
* bpo-32991: Add test capturing expectation.

DocTestFinder.find should return an empty list for doctests in a namespace package.

* bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.
(cherry picked from commit b9650a04a8)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2018-03-06 10:16:11 -05: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) a13b65422a
bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930)
(cherry picked from commit b21d155f57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-02 02:17:51 -08:00
Miss Islington (bot) 398242a5b6 Fixed incorrect default value for dataclass unsafe_hash. (GH-5949) (GH-5950)
(cherry picked from commit 5da8cfb838)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-01 08:30:13 -05: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) 0ea49fc0bf
bpo-30928: Update idlelib/NEWS.txt, possibly for 3.7.0b2 (GH-5932)
(cherry picked from commit 0954c9e9c8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-27 16:07:45 -08: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
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) 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) f8a3485dcd
Revert unneccessary changes made in bpo-30296 and apply other improvements. (GH-2624)
(cherry picked from commit 3f2e6f15d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-26 08:22:24 -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) 1a5790689f
Fix 'deecorator' typo in test/test_dataclasses (GH-5899)
(cherry picked from commit 973cae07d6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-25 19:09:05 -08: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) b6b6669cfd Exhaustively test dataclass hashing when no hash= value is provided. This is in anticipation of changing how non-default hashing is handled. (GH-5834) (GH-5889)
(cherry picked from commit 718070db26)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-25 11:56:30 -05:00
Miss Islington (bot) 83f4394e4e
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
(cherry picked from commit 5fb632e831)

Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
2018-02-25 07:23:25 -08: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) 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