]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years ago3.6.13 v3.6.13
Ned Deily [Tue, 16 Feb 2021 01:30:33 +0000 (20:30 -0500)] 
3.6.13

4 years ago[3.6] bpo-42967: only use '&' as a query string separator (GH-24297) (GH-24532)
Senthil Kumaran [Mon, 15 Feb 2021 19:16:43 +0000 (11:16 -0800)] 
[3.6] bpo-42967: only use '&' as a query string separator (GH-24297)  (GH-24532)

bpo-42967: [security] Address a web cache-poisoning issue reported in
urllib.parse.parse_qsl().

urllib.parse will only us "&" as query string separator by default
instead of both ";" and "&" as allowed in earlier versions. An optional
argument seperator with default value "&" is added to specify the
separator.

Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com>
4 years ago[3.6] closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes...
Benjamin Peterson [Mon, 18 Jan 2021 21:11:46 +0000 (15:11 -0600)] 
[3.6] closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (GH-24250)

(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
4 years ago[3.6] Bring Python into the new year. (GH-24036). (GH-24054)
Dong-hee Na [Sat, 2 Jan 2021 05:27:18 +0000 (14:27 +0900)] 
[3.6] Bring Python into the new year. (GH-24036). (GH-24054)

(cherry picked from commit de6f20a6de48d63066b2cf5b317f50629f01d74a)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
4 years agobpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) ...
Miss Islington (bot) [Fri, 1 Jan 2021 18:42:16 +0000 (10:42 -0800)] 
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) (GH-24042)

(cherry picked from commit ec3165320e81ac87edcb85c86c452528ddbaec1c)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
4 years agobpo-40791: Make compare_digest more constant-time. (GH-23438) (GH-23767)
Miss Islington (bot) [Mon, 14 Dec 2020 17:04:57 +0000 (09:04 -0800)] 
bpo-40791: Make compare_digest more constant-time. (GH-23438) (GH-23767)

The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization.

(This is change GH-1 from https://bugs.python.org/issue40791 .)
(cherry picked from commit 31729366e2bc09632e78f3896dbce0ae64914f28)

Co-authored-by: Devin Jeanpierre <jeanpierreda@google.com>
4 years agobpo-35560: Remove assertion from format(float, "n") (GH-11288) (GH-23231)
Miss Islington (bot) [Tue, 10 Nov 2020 19:58:27 +0000 (11:58 -0800)] 
bpo-35560: Remove assertion from format(float, "n") (GH-11288) (GH-23231)

Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.
(cherry picked from commit 3f7983a25a3d19779283c707fbdd5bc91b1587ef)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
4 years ago[3.6] bpo-42103: Improve validation of Plist files. (GH-22882) (GH-23118)
Serhiy Storchaka [Tue, 10 Nov 2020 19:57:32 +0000 (21:57 +0200)] 
[3.6] bpo-42103: Improve validation of Plist files. (GH-22882) (GH-23118)

* Prevent some possible DoS attacks via providing invalid Plist files
  with extremely large number of objects or collection sizes.
* Raise InvalidFileException for too large bytes and string size instead of returning garbage.
* Raise InvalidFileException instead of ValueError for specific invalid datetime (NaN).
* Raise InvalidFileException instead of TypeError for non-hashable dict keys.
* Add more tests for invalid Plist files..
(cherry picked from commit 34637a0ce21e7261b952fbd9d006474cc29b681f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years ago[3.6] Remove 3.5 from Doc version switcher in master. (GH-22886) (#22891)
larryhastings [Thu, 22 Oct 2020 15:55:36 +0000 (08:55 -0700)] 
[3.6] Remove 3.5 from Doc version switcher in master. (GH-22886) (#22891)

(cherry picked from commit 283f9a253b4ff4df728558205629b3bb3af6e47f)

4 years agobpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests...
Miss Skeleton (bot) [Tue, 20 Oct 2020 04:46:10 +0000 (21:46 -0700)] 
bpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests (GH-22566) (GH-22579)

(cherry picked from commit 2ef5caa58febc8968e670e39e3d37cf8eef3cab8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-42051: Reject XML entity declarations in plist files (GH-22760) (GH-22801) (GH...
Miss Skeleton (bot) [Tue, 20 Oct 2020 04:38:30 +0000 (21:38 -0700)] 
bpo-42051: Reject XML entity declarations in plist files (GH-22760) (GH-22801) (GH-22804)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
(cherry picked from commit e512bc799e3864fe3b1351757261762d63471efc)

Co-authored-by: Ned Deily <nad@python.org>
4 years agoDisable macOS CI tests in azure-pipelines (GH-22639)
Ned Deily [Tue, 20 Oct 2020 04:18:00 +0000 (00:18 -0400)] 
Disable macOS CI tests in azure-pipelines (GH-22639)

4 years agoPost release updates
Ned Deily [Mon, 17 Aug 2020 22:20:24 +0000 (18:20 -0400)] 
Post release updates

4 years ago3.6.12 v3.6.12
Ned Deily [Sat, 15 Aug 2020 06:43:26 +0000 (02:43 -0400)] 
3.6.12

5 years agobpo-39603: Prevent header injection in http methods (GH-18485) (GH-21539)
Miss Islington (bot) [Sun, 19 Jul 2020 09:28:45 +0000 (02:28 -0700)] 
bpo-39603: Prevent header injection in http methods (GH-18485) (GH-21539)

reject control chars in http method in http.client.putrequest to prevent http header injection
(cherry picked from commit 8ca8a2e8fb068863c1138f07e3098478ef8be12e)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
5 years agobpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (#21485)
Miss Islington (bot) [Wed, 15 Jul 2020 12:36:36 +0000 (05:36 -0700)] 
bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (#21485)

Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4)

Co-authored-by: Rishi <rishi_devan@mail.com>
5 years agobpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21462)
Miss Islington (bot) [Mon, 13 Jul 2020 18:18:04 +0000 (11:18 -0700)] 
bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21462)

Automerge-Triggered-By: @tiran
(cherry picked from commit 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years ago[3.6] bpo-29778: Ensure python3.dll is loaded from correct locations when Python...
Steve Dower [Mon, 6 Jul 2020 18:55:43 +0000 (19:55 +0100)] 
[3.6] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298) (#21354)

* bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298)

* bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded.

* Add CVE number

* Updates for 3.6

5 years ago[3.6] bpo-41004: Resolve hash collisions for IPv4Interface and IPv6Interface (GH...
Tapas Kundu [Tue, 30 Jun 2020 19:30:22 +0000 (01:00 +0530)] 
[3.6] bpo-41004: Resolve hash collisions for IPv4Interface and IPv6Interface (GH-21033) (GH-21232)

CVE-2020-14422
The __hash__() methods of classes IPv4Interface and IPv6Interface had issue
of generating constant hash values of 32 and 128 respectively causing hash collisions.
The fix uses the hash() function to generate hash values for the objects
instead of XOR operation
(cherry picked from commit b30ee26e366bf509b7538d79bfec6c6d38d53f28)

Co-authored-by: Ravi Teja P <rvteja92@gmail.com>
Signed-off-by: Tapas Kundu <tkundu@vmware.com>
5 years agoPost release updates
Ned Deily [Sat, 27 Jun 2020 12:38:30 +0000 (08:38 -0400)] 
Post release updates

5 years ago3.6.11 v3.6.11
Ned Deily [Sat, 27 Jun 2020 09:14:00 +0000 (05:14 -0400)] 
3.6.11

5 years agoPost release update
Ned Deily [Thu, 18 Jun 2020 03:54:25 +0000 (23:54 -0400)] 
Post release update

5 years ago3.6.11rc1 v3.6.11rc1
Ned Deily [Wed, 17 Jun 2020 10:59:51 +0000 (06:59 -0400)] 
3.6.11rc1

5 years agobpo-39073: validate Address parts to disallow CRLF (GH-19007) (#19224)
Miss Islington (bot) [Wed, 27 May 2020 23:17:52 +0000 (16:17 -0700)] 
bpo-39073: validate Address parts to disallow CRLF (GH-19007) (#19224)

Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
(cherry picked from commit 614f17211c5fc0e5b828be1d3320661d1038fe8f)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
5 years agoAdd pt-br switcher to the Documentation website (GH-20301)
Rafael Fontenelle [Sat, 23 May 2020 08:00:10 +0000 (05:00 -0300)] 
Add pt-br switcher to the Documentation website (GH-20301)

5 years agoDoc: Python 3.10 in sidebar and version switcher. (GH-20209) (GH-20224)
Miss Islington (bot) [Tue, 19 May 2020 12:34:55 +0000 (05:34 -0700)] 
Doc: Python 3.10 in sidebar and version switcher. (GH-20209) (GH-20224)

(cherry picked from commit 19e3e0026417caa92ffe21a67157363b45da9aa2)

Co-authored-by: Julien Palard <julien@palard.fr>
Co-authored-by: Julien Palard <julien@palard.fr>
5 years agobpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19304)
Victor Stinner [Fri, 3 Apr 2020 01:15:56 +0000 (03:15 +0200)] 
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19304)

The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4)

5 years agobpo-40156: Copy Codecov configuration from master (GH-19306)
Victor Stinner [Fri, 3 Apr 2020 00:34:04 +0000 (02:34 +0200)] 
bpo-40156: Copy Codecov configuration from master (GH-19306)

Disable "Codevov patch" job on pull requests.

5 years agobpo-38576: Disallow control characters in hostnames in http.client (GH-18995) (GH...
Miss Islington (bot) [Sat, 14 Mar 2020 22:35:52 +0000 (15:35 -0700)] 
bpo-38576: Disallow control characters in hostnames in http.client (GH-18995) (GH-19002)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165addc22d05e776a54319a8531ebd0b2fe01ef)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
5 years agobpo-39869: Fix typo in 'Instance objects' section. (GH-18889) (GH-18898)
Miss Islington (bot) [Sat, 14 Mar 2020 22:17:10 +0000 (15:17 -0700)] 
bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) (GH-18898)

(cherry picked from commit e5e56328afac50aad6d8893185d8e7ba8928afe2)

Co-authored-by: Antoine <43954001+awecx@users.noreply.github.com>
5 years agobpo-39545: Document restrictions on "await" and "async for" in f-strings. (GH-18459) 18722/head
Serhiy Storchaka [Thu, 13 Feb 2020 23:53:59 +0000 (01:53 +0200)] 
bpo-39545: Document restrictions on "await" and "async for" in f-strings. (GH-18459)

5 years agobpo-39545: docs: do not use await in f-strings (GH-18434)
Elena Oat [Mon, 10 Feb 2020 20:28:11 +0000 (12:28 -0800)] 
bpo-39545: docs: do not use await in f-strings (GH-18434)

5 years agocloses bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18350)
Miss Islington (bot) [Tue, 4 Feb 2020 22:06:42 +0000 (14:06 -0800)] 
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18350)

When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:

    ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    ==220553==  Access not within mapped region at address 0x2A
    ==220553==    at 0x48408A0: memmove (vg_replace_strmem.c:1272)
    ==220553==    by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)

Reproducer:

    reader = open ("/dev/zero", "rb")
    _void  = reader.read (42)
    reader.close ()
    reader.readinto (bytearray (42)) GH-GH-GH- BANG!

The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f277052e45a60d6c436a765e34722821)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
5 years ago[3.6] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18233)
Steve Dower [Fri, 31 Jan 2020 02:12:20 +0000 (13:12 +1100)] 
[3.6] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18233)

5 years agobpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118...
Miss Islington (bot) [Thu, 23 Jan 2020 14:49:19 +0000 (06:49 -0800)] 
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118) (GH-18146)

(cherry picked from commit 79f89e6e5a659846d1068e8b1bd8e491ccdef861)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoDoc: Change Python 2 status to EOL. (GH-17885) (GH-17887)
Miss Islington (bot) [Tue, 7 Jan 2020 20:52:13 +0000 (12:52 -0800)] 
Doc: Change Python 2 status to EOL. (GH-17885) (GH-17887)

(cherry picked from commit f4800b8ed3dbe15a0078869a836d968ab3362b8c)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
5 years agoUpdate copyright year in macOS installer license copy (GH-17806) (GH-17810)
Ned Deily [Fri, 3 Jan 2020 04:13:59 +0000 (23:13 -0500)] 
Update copyright year in macOS installer license copy (GH-17806) (GH-17810)

5 years ago[3.6] Bring Python into the next decade. (GH-17804)
Benjamin Peterson [Fri, 3 Jan 2020 03:13:57 +0000 (19:13 -0800)] 
[3.6] Bring Python into the next decade. (GH-17804)

(cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agoPost release updates
Ned Deily [Thu, 19 Dec 2019 00:51:13 +0000 (19:51 -0500)] 
Post release updates

5 years ago3.6.10 v3.6.10
Ned Deily [Wed, 18 Dec 2019 19:26:36 +0000 (14:26 -0500)] 
3.6.10

5 years agobpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina...
Miss Islington (bot) [Tue, 17 Dec 2019 09:26:11 +0000 (01:26 -0800)] 
bpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina (GH-17636) (GH-17638)

(cherry picked from commit bf3aa1060a29a05813abbe877193af16e3e7131e)

Co-authored-by: Ned Deily <nad@python.org>
5 years agobpo-39035: travis: Update image to xenial (GH-17622)
Inada Naoki [Mon, 16 Dec 2019 23:20:44 +0000 (08:20 +0900)] 
bpo-39035: travis: Update image to xenial (GH-17622)

5 years ago[3.6] Add whatsnew for removal of asyncio.loop.create_datagram_endpoint()'s *reuse_ad...
Kyle Stanley [Mon, 16 Dec 2019 23:19:36 +0000 (18:19 -0500)] 
[3.6] Add whatsnew for removal of asyncio.loop.create_datagram_endpoint()'s *reuse_address* parameter (GH-17595). (GH-17632)

(cherry picked from commit f501db2b93a9d3d840b6fb38d6bdda8bcc400d4a)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agoFix warnings in test_asyncio.test_base_events (GH-17577) (#17581)
Miss Islington (bot) [Thu, 12 Dec 2019 14:08:48 +0000 (06:08 -0800)] 
Fix warnings in test_asyncio.test_base_events (GH-17577) (#17581)

Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6bff253f017e053f69318ecf03587294)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agoPost release updates
Ned Deily [Wed, 11 Dec 2019 09:37:54 +0000 (04:37 -0500)] 
Post release updates

5 years ago3.6.10rc1 v3.6.10rc1
Ned Deily [Wed, 11 Dec 2019 08:27:49 +0000 (03:27 -0500)] 
3.6.10rc1

5 years ago[3.6] bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH...
Kyle Stanley [Wed, 11 Dec 2019 06:54:02 +0000 (01:54 -0500)] 
[3.6] bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311). (GH-17571)

(cherry picked from commit ab513a38c98695f271e448fe2cb7c5e39eeaaaaf)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agobpo-38945: UU Encoding: Don't let newline in filename corrupt the output format ...
Miss Islington (bot) [Mon, 2 Dec 2019 23:34:31 +0000 (15:34 -0800)] 
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418) (GH-17444)

(cherry picked from commit a62ad4730c9b575f140f24074656c0257c86a09a)

Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
5 years agobpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17343)
Miss Islington (bot) [Fri, 22 Nov 2019 22:09:10 +0000 (14:09 -0800)] 
bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17343)

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 1b779bfb8593739b11cbb988ef82a883ec9d077e)

Co-authored-by: bcaller <bcaller@users.noreply.github.com>
5 years agoUpdate URL in macOS installer copy of license (GH-16905) (GH-16908)
Miss Skeleton (bot) [Wed, 23 Oct 2019 20:29:55 +0000 (13:29 -0700)] 
Update URL in macOS installer copy of license (GH-16905) (GH-16908)

(cherry picked from commit 01659ca62c4508518478a74615ac91c0009427ad)

Co-authored-by: Ned Deily <nad@python.org>
5 years ago[3.6] Fix Zope URL (GH-16880) (GH-16904)
Miss Skeleton (bot) [Wed, 23 Oct 2019 19:33:56 +0000 (12:33 -0700)] 
[3.6] Fix Zope URL (GH-16880) (GH-16904)

(cherry picked from commit dfe726b1ace03f206f45253b93ed7610473ae20f)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agoUpdate doc switcher list for 3.8.0 (GH-16809) (GH-16812)
Miss Islington (bot) [Tue, 15 Oct 2019 21:46:19 +0000 (14:46 -0700)] 
Update doc switcher list for 3.8.0 (GH-16809) (GH-16812)

(cherry picked from commit 3f36043db22361500f52634f2b8de49dde0e7da9)

Co-authored-by: Ned Deily <nad@python.org>
5 years agoDoc: 3.8 is now stable. (GH-16790) (GH-16793)
Miss Islington (bot) [Mon, 14 Oct 2019 22:21:43 +0000 (15:21 -0700)] 
Doc: 3.8 is now stable. (GH-16790) (GH-16793)

(cherry picked from commit 4504b4500d2a1a80c26b27b0bfff8b624d5ce06c)

Co-authored-by: Julien Palard <julien@palard.fr>
5 years ago[3.6] bpo-38216, bpo-36274: Allow subclasses to separately override validation and...
Jason R. Coombs [Sat, 28 Sep 2019 16:44:12 +0000 (12:44 -0400)] 
[3.6] bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448) (GH-16462)

(cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
5 years agobpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441)
Victor Stinner [Sat, 28 Sep 2019 07:33:00 +0000 (09:33 +0200)] 
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441)

Escape the server title of xmlrpc.server.DocXMLRPCServer
when rendering the document page as HTML.

(cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa)

5 years ago[3.6] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16410)
Benjamin Peterson [Thu, 26 Sep 2019 05:00:26 +0000 (22:00 -0700)] 
[3.6] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16410)

Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes..
(cherry picked from commit 52b940803860e37bcc3f6096b2d24e7c20a0e807)

5 years ago[3.6] bpo-37461: Fix typo (inifite -> infinite) (#15432)
GeeTransit [Sat, 24 Aug 2019 04:33:36 +0000 (00:33 -0400)] 
[3.6] bpo-37461: Fix typo (inifite -> infinite) (#15432)

6 years agobpo-34155: Dont parse domains containing @ (GH-13079) (GH-14826)
Miss Islington (bot) [Fri, 9 Aug 2019 15:22:19 +0000 (08:22 -0700)] 
bpo-34155: Dont parse domains containing @ (GH-13079) (GH-14826)

Before:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='a', domain='malicious.org'),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@malicious.org')

    After:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='', domain=''),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@')

https://bugs.python.org/issue34155
(cherry picked from commit 8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9)

Co-authored-by: jpic <jpic@users.noreply.github.com>
6 years agobpo-37461: Fix infinite loop in parsing of specially crafted email headers (GH-14794...
Miss Islington (bot) [Thu, 1 Aug 2019 16:36:46 +0000 (09:36 -0700)] 
bpo-37461: Fix infinite loop in parsing of specially crafted email headers (GH-14794) (GH-14817)

Some crafted email header would cause the get_parameter method to run in an
infinite loop causing a DoS attack surface when parsing those headers. This
patch fixes that by making sure the DQUOTE character is handled to prevent
going into an infinite loop.
(cherry picked from commit a4a994bd3e619cbaff97610a1cee8ffa87c672f5)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
6 years agoFix infinite loop in email folding logic (GH-12732) (GH-14799)
Miss Islington (bot) [Sun, 21 Jul 2019 14:01:43 +0000 (07:01 -0700)] 
Fix infinite loop in email folding logic (GH-12732) (GH-14799)

As far as I can tell, this infinite loop would be triggered if:

1. The value being folded contains a single word (no spaces) longer than
   max_line_length
2. The max_line_length is shorter than the encoding's name + 9
   characters.

bpo-36564: https://bugs.python.org/issue36564
(cherry picked from commit f69d5c61981ea97d251db515c7ff280fcc17182d)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
6 years agobpo-37149: Replace dead link for online Tkinter reference (GH-14616)
Ned Deily [Mon, 8 Jul 2019 16:50:54 +0000 (12:50 -0400)] 
bpo-37149: Replace dead link for online Tkinter reference  (GH-14616)

Also fix a name misspelling.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
6 years agoFix 3.6 documentation build for sphinx<1.6 (GH-14576)
Anthony Sottile [Wed, 3 Jul 2019 22:39:49 +0000 (18:39 -0400)] 
Fix 3.6 documentation build for sphinx<1.6 (GH-14576)

6 years agoPost release updates
Ned Deily [Tue, 2 Jul 2019 21:57:03 +0000 (17:57 -0400)] 
Post release updates

6 years ago3.6.9 v3.6.9
Ned Deily [Tue, 2 Jul 2019 20:25:39 +0000 (16:25 -0400)] 
3.6.9

6 years agobpo-34602: Avoid failures setting macOS stack resource limit (GH-14546) (GH-14549)
Miss Islington (bot) [Tue, 2 Jul 2019 07:48:59 +0000 (00:48 -0700)] 
bpo-34602: Avoid failures setting macOS stack resource limit (GH-14546) (GH-14549)

Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  Reverting the change to the interpreter stack size at link
time helped for release builds but caused some tests to fail when
built --with-pydebug.  Try the opposite approach: continue to build
the interpreter with an increased stack size on macOS and remove
the failing setrlimit call in regrtest initialization.  This will
definitely avoid the resource.RLIMIT_STACK error and should have
no, or fewer, side effects.
(cherry picked from commit 5bbbc733e6cc0804f19b071944af8d4719e26ae6)

Co-authored-by: Ned Deily <nad@python.org>
6 years agoPut pyexpatns.h include back. bpo-37437 (GH-14542)
Miss Islington (bot) [Tue, 2 Jul 2019 05:48:16 +0000 (22:48 -0700)] 
Put pyexpatns.h include back. bpo-37437 (GH-14542)

(cherry picked from commit 2cd07920bb7d2d319999394092190f37935dc421)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
6 years agobpo-37437: Pass -Wno-unreachable-code when compiling expat. (GH-14470) (GH-14472)
Miss Islington (bot) [Sun, 30 Jun 2019 00:36:29 +0000 (17:36 -0700)] 
bpo-37437: Pass -Wno-unreachable-code when compiling expat. (GH-14470) (GH-14472)

(cherry picked from commit 95da310078a9364bae9ab3f2ad9c71e34306a70c)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
6 years agocloses bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
Miss Islington (bot) [Fri, 28 Jun 2019 04:16:48 +0000 (21:16 -0700)] 
closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)

(cherry picked from commit 3b03b09fc94425915c5b1225e9200a3a95bc827b)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
6 years agoPost release updates
Ned Deily [Wed, 19 Jun 2019 03:50:05 +0000 (23:50 -0400)] 
Post release updates

6 years ago3.6.9rc1 v3.6.9rc1
Ned Deily [Wed, 19 Jun 2019 00:37:44 +0000 (20:37 -0400)] 
3.6.9rc1

6 years agobpo-33529, email: Fix infinite loop in email header encoding (GH-12020) (GH-14162)
Victor Stinner [Tue, 18 Jun 2019 00:13:58 +0000 (02:13 +0200)] 
bpo-33529, email: Fix infinite loop in email header encoding (GH-12020) (GH-14162)

(cherry picked from commit c1f5667be1e3ec5871560c677402c1252c6018a6)

6 years agoDoc: Remove an ugly space before a dot. (GH-14123) (GH-14130)
Miss Islington (bot) [Sun, 16 Jun 2019 18:55:59 +0000 (11:55 -0700)] 
Doc: Remove an ugly space before a dot. (GH-14123) (GH-14130)

(cherry picked from commit 552951563cd5968d25e95306362e41f07d661a88)

Co-authored-by: Julien Palard <julien@palard.fr>
6 years ago[3.6] Doc: Add an optional obsolete header. (GH-13638). (GH-13657)
Julien Palard [Sat, 15 Jun 2019 18:25:03 +0000 (20:25 +0200)] 
[3.6] Doc: Add an optional obsolete header. (GH-13638). (GH-13657)

(cherry picked from commit 46ed90dd014010703c7a3b2a61c4927644fa8210)

Co-authored-by: Julien Palard <julien@palard.fr>
6 years ago[3.6] Doc fix: duplicate object description of email.message (GH-13742) (GH-14041)
Ned Deily [Thu, 13 Jun 2019 04:35:19 +0000 (00:35 -0400)] 
[3.6] Doc fix: duplicate object description of email.message (GH-13742) (GH-14041)

6 years agoStop using deprecated logging API in Sphinx suspicious checker (GH-9875) (GH-13923)
Miss Islington (bot) [Sun, 9 Jun 2019 00:54:57 +0000 (17:54 -0700)] 
Stop using deprecated logging API in Sphinx suspicious checker (GH-9875) (GH-13923)

(cherry picked from commit ee171a26c1169abfae534b08acc0d95c6e45a22a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
6 years agoDoc: Python 3.9 in sidebar and version switcher. (GH-13824) (GH-13827)
Miss Islington (bot) [Tue, 4 Jun 2019 23:22:50 +0000 (16:22 -0700)] 
Doc: Python 3.9 in sidebar and version switcher. (GH-13824) (GH-13827)

(cherry picked from commit 59e7bbcaa4d0d556591f774c5ea4869c41fa95b0)

Co-authored-by: Julien Palard <julien@palard.fr>
6 years agobpo-36742: Corrects fix to handle decomposition in usernames (GH-13812) (GH-13814)
Miss Islington (bot) [Tue, 4 Jun 2019 18:43:52 +0000 (11:43 -0700)] 
bpo-36742: Corrects fix to handle decomposition in usernames (GH-13812) (GH-13814)

(cherry picked from commit 8d0ef0b5edeae52960c7ed05ae8a12388324f87e)

Co-authored-by: Steve Dower <steve.dower@python.org>
6 years agobpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-13513)
Victor Stinner [Wed, 29 May 2019 02:30:48 +0000 (04:30 +0200)] 
bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-13513)

CVE-2019-9948: Avoid file reading by disallowing local-file:// and
local_file:// URL schemes in URLopener().open() and
URLopener().retrieve() of urllib.request.

Co-Authored-By: SH <push0ebp@gmail.com>
(cherry picked from commit 0c2b6a3943aa7b022e8eb4bfd9bffcddebf9a587)
(cherry picked from commit 34bab215596671d0dec2066ae7d7450cd73f638b)

6 years ago[3.6] bpo-35925: Skip SSL tests that fail due to weak external certs or old TLS ...
Gregory P. Smith [Wed, 29 May 2019 02:08:28 +0000 (19:08 -0700)] 
[3.6] bpo-35925: Skip SSL tests that fail due to weak external certs or old TLS (GH-13124) (GH-13252)

* [3.6] bpo-35925: Skip SSL tests that fail due to weak external certs. (GH-13124)

Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default.  This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a failure.

Fixing the network servers is a separate issue..
(cherry picked from commit 2cc0223f43a1ffd59c887a73e2b0ce5202f3be90)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
* Also skip ssl tests that fail when the system rejects TLSv1.

* Remove the test_httplib change; server was updated.

self-signed.pythontest.net was updated so the test_httplib change is
no longer necessary.

6 years agobpo-32947: test_ssl fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-11612)
Victor Stinner [Wed, 29 May 2019 02:04:54 +0000 (04:04 +0200)] 
bpo-32947: test_ssl fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-11612)

Backport partially commit 529525fb5a8fd9b96ab4021311a598c77588b918:
complete the previous partial backport (commit
2a4ee8aa01d61b6a9c8e9c65c211e61bdb471826.

Co-Authored-By: Christian Heimes <christian@python.org>
6 years ago[3.6] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192) (GH-13198)
Gregory P. Smith [Wed, 8 May 2019 19:20:59 +0000 (14:20 -0500)] 
[3.6] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192) (GH-13198)

We updated the server, our testsuite must match.

https://bugs.python.org/issue36816

✈️ CLE -> DEN ✈️ GH-pycon2019
(cherry picked from commit 6bd81734de0b73f1431880d6a75fb71bcbc65fa1)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
6 years agobpo-30458: Disallow control chars in http URLs. (GH-12755) (GH-13155)
Miro Hrončok [Wed, 8 May 2019 16:33:24 +0000 (18:33 +0200)] 
bpo-30458: Disallow control chars in http URLs. (GH-12755) (GH-13155)

Disallow control chars in http URLs in urllib.urlopen.  This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.

Disable https related urllib tests on a build without ssl (GH-13032)
These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.

Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044)

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
6 years agobpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017...
Miss Islington (bot) [Thu, 2 May 2019 16:02:35 +0000 (09:02 -0700)] 
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017) (GH-13024)

(cherry picked from commit d537ab0ff9767ef024f26246899728f0116b1ec3)

Co-authored-by: Steve Dower <steve.dower@python.org>
6 years agobpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) (GH-12910)
Miss Islington (bot) [Thu, 2 May 2019 16:00:33 +0000 (09:00 -0700)] 
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) (GH-12910)

(cherry picked from commit 56ed86490cb8221c874d432461d77702437f63e5)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) (GH-13014)
Miss Islington (bot) [Mon, 29 Apr 2019 19:56:58 +0000 (12:56 -0700)] 
bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) (GH-13014)

Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  For now, revert the original change and resume using
the default stack size when linking the interpreter.
(cherry picked from commit 883dfc668f9730b00928730035b5dbd24b9da2a0)

Co-authored-by: Ned Deily <nad@python.org>
6 years ago[3.6] bpo-35564: add master_doc='contents' to conf.py (GH-11290). (GH-12461) 12474/head 12558/head
Julien Palard [Wed, 20 Mar 2019 15:41:20 +0000 (16:41 +0100)] 
[3.6] bpo-35564: add master_doc='contents' to conf.py (GH-11290). (GH-12461)

(cherry picked from commit fc8284e22074af8154e9865c8391b955f13a308b)

Co-authored-by: Jean-François B <jfbu@free.fr>
6 years agoFix "catchs" typos in NEWS entries (GH-12366)
Harmon [Mon, 18 Mar 2019 02:11:57 +0000 (21:11 -0500)] 
Fix "catchs" typos in NEWS entries (GH-12366)

6 years agobpo-36195: Remove the ThreadPoolExecutor documentation mentioning the initializer...
Harmandeep Singh [Mon, 18 Mar 2019 01:53:07 +0000 (07:23 +0530)] 
bpo-36195: Remove the ThreadPoolExecutor documentation mentioning the initializer feature added in Python 3.7 (GH-12182)

6 years ago[3.6] bpo-36216: Add check for characters in netloc that normalize to separators...
Steve Dower [Tue, 12 Mar 2019 04:34:03 +0000 (21:34 -0700)] 
[3.6] bpo-36216: Add check for characters in netloc that normalize to separators (GH-12201) (GH-12215)

6 years agobpo-35647: Fix path check in cookiejar (GH-11436) (GH-12268)
Miss Islington (bot) [Tue, 12 Mar 2019 04:28:39 +0000 (21:28 -0700)] 
bpo-35647: Fix path check in cookiejar (GH-11436) (GH-12268)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
6 years agobpo-35121: prefix dot in domain for proper subdomain validation (GH-10258) (GH-12260)
Miss Islington (bot) [Sun, 10 Mar 2019 02:59:28 +0000 (18:59 -0800)] 
bpo-35121: prefix dot in domain for proper subdomain validation (GH-10258) (GH-12260)

Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy.  Patch by Karthikeyan Singaravelan.
(cherry picked from commit ca7fe5063593958e5efdf90f068582837f07bd14)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
6 years agoDocument the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084) 12121/head 12122/head
Miss Islington (bot) [Wed, 27 Feb 2019 23:46:08 +0000 (15:46 -0800)] 
Document the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084)

(cherry picked from commit 4173772031747a9b249be4100b4aa9eda805ea23)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
6 years agobpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12011...
Miss Islington (bot) [Sun, 24 Feb 2019 07:56:12 +0000 (23:56 -0800)] 
bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12011) (GH-12013)

(cherry picked from commit aeca373b339e0ea9739536ce6b43bd90f3b89873)

Co-authored-by: Ned Deily <nad@python.org>
6 years agobpo-35746: Credit Colin Read and Nicolas Edet (GH-11865)
Victor Stinner [Sat, 16 Feb 2019 07:23:52 +0000 (08:23 +0100)] 
bpo-35746: Credit Colin Read and Nicolas Edet (GH-11865)

Add credit for the cert parser vulnerability. Mention also Cisco
TALOS-2018-0758 identifier.

6 years agoDoc sidebar: 3.6 has moved to security-fix mode. (GH-11810) (GH-11812)
Miss Islington (bot) [Sun, 10 Feb 2019 22:07:24 +0000 (14:07 -0800)] 
Doc sidebar: 3.6 has moved to security-fix mode. (GH-11810) (GH-11812)

(cherry picked from commit 9db56fb8faaa3cd66e7fe82740a4ae4d786bb27f)

Co-authored-by: Julien Palard <julien@palard.fr>
6 years ago[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368)
Anthony Sottile [Sun, 3 Feb 2019 23:22:52 +0000 (15:22 -0800)] 
[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368)

6 years agobpo-35486: Note Py3.6 import system API requirement change (GH-11540) (GH-11588)
Miss Islington (bot) [Fri, 18 Jan 2019 01:11:09 +0000 (17:11 -0800)] 
bpo-35486: Note Py3.6 import system API requirement change (GH-11540) (GH-11588)

While the introduction of ModuleNotFoundError was fully backwards
compatible on the import API consumer side, folks providing alternative
implementations of `__import__` need to make an update to be
forward compatible with clients that start relying on the new subclass.

https://bugs.python.org/issue35486
(cherry picked from commit cee29b46a19116261b083dc803217aa754c7df40)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
6 years agobpo-35525: Correct the argument name for NNTP.starttls() (GH-11310) (GH-11417)
Miss Islington (bot) [Fri, 18 Jan 2019 01:07:39 +0000 (17:07 -0800)] 
bpo-35525: Correct the argument name for NNTP.starttls() (GH-11310) (GH-11417)

(cherry picked from commit e9a044ec16989bd4b39763c0588c17200a925350)

Co-authored-by: Harmandeep Singh <harmandeep3091@gmail.com>
6 years agoMake sure file object is close if socket.create_connection fails (GH-11334) (GH-11351)
Miss Islington (bot) [Fri, 18 Jan 2019 01:02:43 +0000 (17:02 -0800)] 
Make sure file object is close if socket.create_connection fails (GH-11334) (GH-11351)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
(cherry picked from commit 1f511e1af060e98fb789319a96076c06e7f98135)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
6 years agobpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH...
Miss Islington (bot) [Fri, 18 Jan 2019 01:00:46 +0000 (17:00 -0800)] 
bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH-11337) (GH-11348)

There is a race condition regarding signal delivery in test_signal_handling_args for
test_asyncio.test_events.KqueueEventLoopTests. The signal can be received at any moment outside the time window provided in the test. The fix is to wait for the signal to be received instead with a bigger timeout.
(cherry picked from commit 5471420faa84519530f29b08f2b042b2288e3e96)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>