Commit Graph

103482 Commits

Author SHA1 Message Date
Miss Islington (bot) 13ee023c03 bpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina (GH-17636)
(cherry picked from commit bf3aa1060a)

Co-authored-by: Ned Deily <nad@python.org>
2019-12-18 13:39:27 -05:00
Miss Islington (bot) 9346209be4 Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17580)
Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6b)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-18 13:39:14 -05:00
Kyle Stanley 3413f5cab0 [3.7] Add whatsnew for removal of asyncio.loop.create_datagram_endpoint()'s *reuse_address* parameter (GH-17595). (GH-17631)
(cherry picked from commit f501db2b93)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-18 13:38:51 -05:00
Inada Naoki 9af4974195 bpo-39035: travis: Don't use beta group (GH-17604) 2019-12-18 13:38:36 -05:00
Inada Naoki b4f98f412a Add PYTHONUTF8 to commandline usage. (GH-17587) (GH-17599)
Co-Authored-By: Victor Stinner <vstinner@python.org>
(cherry picked from commit 95826c773a)
2019-12-18 13:38:18 -05:00
Ned Deily 85924a45b7 Post release updates 2019-12-11 03:49:48 -05:00
Ned Deily bd18254b91 3.7.6rc1 2019-12-11 00:24:09 -05:00
Ned Deily 95157c6a28
bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311) (GH-17570)
(cherry picked from commit ab513a38c9)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-10 23:49:23 -05:00
Miss Islington (bot) 1b0e88dde1
bpo-38943: Fix IDLE autocomplete window not always appearing (GH-17416)
This has happened on some versions of Ubuntu.
(cherry picked from commit bbc4162baf)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 16:46:14 -08:00
Miss Islington (bot) 4e0e452dd0
bpo-38944: Escape key now closes IDLE completion windows. (GH-17419)
(cherry picked from commit 232689b40d)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 15:40:09 -08:00
Miss Islington (bot) 66d7a5d58a bpo-34776: Fix dataclasses to support __future__ "annotations" mode (GH-9518) (#17532)
(cherry picked from commit d219cc4180)

Co-authored-by: Yury Selivanov <yury@magic.io>
2019-12-09 17:07:54 +01:00
Miss Islington (bot) a0078d9a33
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
Fix asyncio when the ssl module is missing: only check for
ssl.SSLSocket instance if the ssl module is available.
(cherry picked from commit 82b4950b5e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 06:20:27 -08:00
Miss Islington (bot) 21e11383cc
bpo-38916: Document array.array deprecation (GH-17523)
array.array: Document that tostring() and fromstring() deprecated
aliases will be removed in Python 3.9.
(cherry picked from commit 0381ea79ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 05:52:07 -08:00
Miss Islington (bot) 188d5ae6f0 bpo-38673: dont switch to ps2 if the line starts with comment or whitespace (GH-17421) (GH-17522)
https://bugs.python.org/issue38673
(cherry picked from commit 109fc2792a)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2019-12-09 06:38:36 -05:00
Miss Islington (bot) b9f4b49c6e
bpo-38547: Fix test_pty if the process is the session leader (GH-17519)
Fix test_pty: if the process is the session leader, closing the
master file descriptor raises a SIGHUP signal: simply ignore SIGHUP
when running the tests.
(cherry picked from commit a1838ec259)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 03:15:07 -08:00
Miss Islington (bot) 41973c99fd bpo-38669: patch.object now raises a helpful error (GH17511)
This means a clearer message is now shown when patch.object is called with two string arguments, rather than a class and a string argument.
(cherry picked from commit cd90a52983)

Co-authored-by: Elena Oat <oat.elena@gmail.com>
2019-12-09 06:59:23 +00:00
Miss Islington (bot) 9baa870c27
bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None.

https://bugs.python.org/issue38979

Automerge-Triggered-By: @asvetlov
(cherry picked from commit 28c91631c2)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2019-12-08 03:53:07 -08:00
Miss Islington (bot) a197f8aa74
[3.7] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17500)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

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


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696b)


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


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
2019-12-07 09:20:43 -08:00
Miss Islington (bot) a85066df94
bpo-37404: Raising value error if an SSLSocket is passed to asyncio functions (GH-16457)
https://bugs.python.org/issue37404
(cherry picked from commit 892f9e0777)

Co-authored-by: idomic <michael.ido@gmail.com>
2019-12-07 04:45:07 -08:00
Andrew Svetlov 8ce85a31e6
[3.7] Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version (GH-17484) (GH-17494)
(cherry picked from commit 969ae7aca8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 13:46:18 +02:00
Miss Islington (bot) 5ba591fa2c
bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py (GH-13135)
Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute.

https://bugs.python.org/issue36820

Automerge-Triggered-By: @pablogsal
(cherry picked from commit b64334cb93)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-12-06 07:01:31 -08:00
Miss Islington (bot) 5044c889df
bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467)
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b787964e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-04 12:29:22 -08:00
Inada Naoki e0f148e663
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
(cherry picked from commit 808769f3a4)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-04 19:26:22 +09:00
Miss Islington (bot) 55a7046471
bpo-27873: Update docstring for multiprocessing.Pool.map (GH-17436)
Update docstring for `multiprocessing.Pool.map` to mention `pool.starmap()`.

Prev PR: https://github.com/python/cpython/pull/17367  @aeros

https://bugs.python.org/issue27873
(cherry picked from commit eb48a451e3)

Co-authored-by: An Long <aisk@users.noreply.github.com>
2019-12-03 15:36:47 -08:00
Miss Islington (bot) 87f2d261ee
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418)
(cherry picked from commit a62ad4730c)

Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
2019-12-02 14:43:15 -08:00
Miss Islington (bot) 1f4f28cbf3
bpo-38815: Accept TLSv3 default in min max test (GH-NNNN) (GH-17437)
Make ssl tests less strict and also accept TLSv3 as the default maximum
version. This change unbreaks test_min_max_version on Fedora 32.

https://bugs.python.org/issue38815
(cherry picked from commit 34864d1cff)

Co-authored-by: torsava <torsava@redhat.com>
2019-12-02 08:35:50 -08:00
Miss Islington (bot) 926eabb6b4
bpo-38449: Add URL delimiters test cases (GH-16729)
* bpo-38449: Add tricky test cases

* bpo-38449: Reflect codereview
(cherry picked from commit 2fe4c48917)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-12-01 15:23:32 -08:00
Miss Islington (bot) cbac6ee3f6
document threading.Lock.locked() (GH-17427)
(cherry picked from commit fdafa1d0ed)

Co-authored-by: idomic <michael.ido@gmail.com>
2019-12-01 12:13:18 -08:00
Miss Islington (bot) 7e9bbbe51e
bpo-38524: clarify example a bit and improve formatting (GH-17406)
(cherry picked from commit 02519f75d1)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-11-27 21:28:37 -08:00
Inada Naoki e65b3fa9f1
bpo-26730: Fix SpooledTemporaryFile data corruption (GH-17400)
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>.
(cherry picked from commit ea9835c5d1)
2019-11-28 14:23:58 +09:00
Miss Islington (bot) cd27d22ac9
bpo-38524: document implicit and explicit calling of descriptors' __set_name__ (GH-17364)
(cherry picked from commit 1bddf890e5)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2019-11-27 00:52:39 -08:00
Terry Jan Reedy 2fb971940b
[3.7] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366) (#17379)
Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
(cherry picked from commit 6bf644ec82)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-26 20:12:56 -05:00
Miss Islington (bot) 2f2489310d bpo-21063: Improve module synopsis for distutils (GH-17363) (#17381)
(cherry picked from commit f8a6316778)

Co-authored-by: Sanchit Khurana <54467174+GeniusLearner@users.noreply.github.com>
2019-11-26 12:02:24 -08:00
Miss Islington (bot) 1f86401695
Remove use of deprecated `array.fromstring` method (GH-17332)
(cherry picked from commit 386d00cc34)

Co-authored-by: David Coles <coles.david@gmail.com>
2019-11-25 22:37:31 -08:00
Miss Islington (bot) 07432c33a0
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
* fix HTTP Digest handling in request.py

There is a bug triggered when server replies to a request with `WWW-Authenticate: Digest` where `qop="auth,auth-int"` rather than mere `qop="auth"`. Having both `auth` and `auth-int` is legitimate according to the `qop-options` rule in §3.2.1 of [[https://www.ietf.org/rfc/rfc2617.txt|RFC 2617]]:
>      qop-options       = "qop" "=" <"> 1GH-qop-value <">
>      qop-value         = "auth" | "auth-int" | token
> **qop-options**: [...] If present, it is a quoted string **of one or more** tokens indicating the "quality of protection" values supported by the server.  The value `"auth"` indicates authentication; the value `"auth-int"` indicates authentication with integrity protection

This is description confirmed by the definition of the [//n//]`GH-`[//m//]//rule// extended-BNF pattern defined in §2.1 of [[https://www.ietf.org/rfc/rfc2616.txt|RFC 2616]] as 'a comma-separated list of //rule// with at least //n// and at most //m// items'.

When this reply is parsed by `get_authorization`, request.py only tests for identity with `'auth'`, failing to recognize it as one of the supported modes the server announced, and claims that `"qop 'auth,auth-int' is not supported"`.

* 📜🤖 Added by blurb_it.

* bpo-38686 review fix: remember why.

* fix trailing space in Lib/urllib/request.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 14a89c4798)

Co-authored-by: PypeBros <PypeBros@users.noreply.github.com>
2019-11-22 15:38:37 -08:00
Miss Islington (bot) c58a811647
closes bpo-29275: Remove Y2K reference from time module docs (GH-17321)
The Y2K reference is not needed as it only points out that Python's use
of C standard functions doesn't generally suffer from Y2K issues; the
point regarding conventions for conversion of 2-digit years in
:func:`strptime` is still valid.
(cherry picked from commit 42bc60ead3)

Co-authored-by: Callum Ward <wards.callum@gmail.com>
2019-11-22 09:03:04 -08:00
Miss Islington (bot) cb6085138a
bpo-38804: Fix REDoS in http.cookiejar (GH-17157)
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) > 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bfb85)

Co-authored-by: bcaller <bcaller@users.noreply.github.com>
2019-11-22 06:42:13 -08:00
Miss Islington (bot) d4d79209e6 bpo-22367: Update test_fcntl.py for spawn process mode (GH-17154) (GH-17253)
(cherry picked from commit 9960230f76)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-11-22 15:15:42 +01:00
Miss Islington (bot) bff5255664
bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338)
Increment properly Py_True/Py_False reference counter for
_testcapi.WITH_PYMALLOC variable.
(cherry picked from commit 84c36c152a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-11-22 04:56:59 -08:00
Miss Islington (bot) 91c15a542c [3.7] bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097) (GH-17224)
(cherry picked from commit 106271568c)
2019-11-21 21:47:22 +00:00
Miss Islington (bot) 30e5bd8471
bpo-37838: get_type_hints for wrapped functions with forward reference (GH-17126)
https://bugs.python.org/issue37838
(cherry picked from commit 0aca3a3a1e)

Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
2019-11-21 09:43:13 -08:00
Miss Islington (bot) 97c301bfc5
bpo-36277: Add document for pdb debug and retval commands (GH-12872)
https://bugs.python.org/issue36277

Automerge-Triggered-By: @csabella
(cherry picked from commit 9391f6c3ef)

Co-authored-by: Dave Nguyen <dv@dvnguyen.com>
2019-11-20 17:56:43 -08:00
Miss Islington (bot) 7efeb75b72
Fixed an incorrect sentence in the docs (GH-17205)
Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on
while translating the file.

skip issue

Automerge-Triggered-By: @csabella
(cherry picked from commit 06ca2a2be9)

Co-authored-by: Aveheuzed <a.masson555@ntymail.com>
2019-11-20 17:24:51 -08:00
Miss Islington (bot) ecb2afc1bc
bpo-38821: Fix crash in argparse when using gettext (GH-17192)
(cherry picked from commit be5c79e033)

Co-authored-by: Federico Bond <federicobond@gmail.com>
2019-11-20 05:48:20 -08:00
Miss Islington (bot) 1d7245c3e0
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
(cherry picked from commit d51a363a43)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-20 02:26:54 -08:00
Miss Islington (bot) 63f09e7628
bpo-38823: Fix refleak in marshal init error path (GH-17260)
(cherry picked from commit 33b671e724)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-20 02:15:22 -08:00
Miss Islington (bot) 755caaa753
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
These Format menu functions (default shortcuts Alt-T and Alt-U)
were mistakenly disabled in 3.7.5 and 3.8.0.
(cherry picked from commit b8462477bf)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-19 22:37:09 -08:00
Miss Islington (bot) 5bd2af9c79
bpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)
(cherry picked from commit ac2235432c)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-19 15:30:02 -08:00
Miss Islington (bot) 4ffc569b47
bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator.

https://bugs.python.org/issue35409
(cherry picked from commit 8e0de2a480)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2019-11-19 06:12:12 -08:00
Miss Islington (bot) 2b928d9bf7
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://bugs.python.org/issue38809
(cherry picked from commit ee703cbb41)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-11-18 09:53:14 -08:00