summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorjmbills <42755197+jmbills@users.noreply.github.com>2019-10-25 19:18:16 +0300
committerGitHub <noreply@github.com>2019-10-25 19:18:16 +0300
commit0dbb60593ebb5a62190c0e6cff7f1770493303a2 (patch)
tree0df2ce67404dbca3ddc4ee063dbfd9ae455be682 /poky/meta/recipes-devtools/python
parent34a3942845ac3264ce27c648ae5486d302c3e6d8 (diff)
parentcc9cea46d74d280de03c713c8b555153fd811f09 (diff)
downloadopenbmc-0dbb60593ebb5a62190c0e6cff7f1770493303a2.tar.xz
Merge branch 'intel' into intel2
Diffstat (limited to 'poky/meta/recipes-devtools/python')
-rw-r--r--poky/meta/recipes-devtools/python/python-nose_1.3.7.bb6
-rw-r--r--poky/meta/recipes-devtools/python/python-scons-native_3.0.5.bb8
-rw-r--r--poky/meta/recipes-devtools/python/python-scons_3.0.5.bb24
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools.inc4
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools_41.2.0.bb (renamed from poky/meta/recipes-devtools/python/python-setuptools_41.0.1.bb)0
-rw-r--r--poky/meta/recipes-devtools/python/python-testtools.inc1
-rw-r--r--poky/meta/recipes-devtools/python/python.inc7
-rw-r--r--poky/meta/recipes-devtools/python/python/CVE-2018-20852.patch123
-rw-r--r--poky/meta/recipes-devtools/python/python/CVE-2019-9740.patch216
-rw-r--r--poky/meta/recipes-devtools/python/python3-dbus_1.2.12.bb (renamed from poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb)12
-rw-r--r--poky/meta/recipes-devtools/python/python3-docutils_0.15.bb (renamed from poky/meta/recipes-devtools/python/python3-docutils_0.14.bb)5
-rw-r--r--poky/meta/recipes-devtools/python/python3-git_2.1.11.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-git_3.0.2.bb (renamed from poky/meta/recipes-devtools/python/python-git.inc)9
-rw-r--r--poky/meta/recipes-devtools/python/python3-mako_1.0.10.bb3
-rw-r--r--poky/meta/recipes-devtools/python/python3-mako_1.1.0.bb (renamed from poky/meta/recipes-devtools/python/python-mako.inc)8
-rw-r--r--poky/meta/recipes-devtools/python/python3-pbr_5.2.0.bb5
-rw-r--r--poky/meta/recipes-devtools/python/python3-pbr_5.4.3.bb5
-rw-r--r--poky/meta/recipes-devtools/python/python3-pip_19.2.3.bb (renamed from poky/meta/recipes-devtools/python/python3-pip_19.1.1.bb)5
-rw-r--r--poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb (renamed from poky/meta/recipes-devtools/python/python3-pygobject_3.32.1.bb)10
-rw-r--r--poky/meta/recipes-devtools/python/python3-scons-native_3.1.1.bb (renamed from poky/meta/recipes-devtools/python/python3-scons-native_3.0.5.bb)0
-rw-r--r--poky/meta/recipes-devtools/python/python3-scons_3.1.1.bb (renamed from poky/meta/recipes-devtools/python/python3-scons_3.0.5.bb)4
-rw-r--r--poky/meta/recipes-devtools/python/python3-setuptools_41.2.0.bb (renamed from poky/meta/recipes-devtools/python/python3-setuptools_41.0.1.bb)0
-rw-r--r--poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python3/python3-manifest.json31
-rw-r--r--poky/meta/recipes-devtools/python/python3_3.7.4.bb (renamed from poky/meta/recipes-devtools/python/python3_3.7.3.bb)20
-rw-r--r--poky/meta/recipes-devtools/python/python_2.7.16.bb6
29 files changed, 505 insertions, 120 deletions
diff --git a/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb b/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
deleted file mode 100644
index fab609df9..000000000
--- a/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-inherit setuptools
-require python-nose.inc
-
-do_install_append() {
- rm ${D}${bindir}/nosetests
-}
diff --git a/poky/meta/recipes-devtools/python/python-scons-native_3.0.5.bb b/poky/meta/recipes-devtools/python/python-scons-native_3.0.5.bb
deleted file mode 100644
index 68b63c935..000000000
--- a/poky/meta/recipes-devtools/python/python-scons-native_3.0.5.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require python-scons_${PV}.bb
-inherit native pythonnative
-DEPENDS = "python-native"
-RDEPENDS_${PN} = ""
-
-do_install_append() {
- create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}' PYTHONNOUSERSITE='1'
-}
diff --git a/poky/meta/recipes-devtools/python/python-scons_3.0.5.bb b/poky/meta/recipes-devtools/python/python-scons_3.0.5.bb
deleted file mode 100644
index 939c15bcc..000000000
--- a/poky/meta/recipes-devtools/python/python-scons_3.0.5.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "Software Construction tool (make/autotools replacement)"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=37bb53a08e6beaea0c90e7821d731284"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
-SRC_URI[md5sum] = "9f9c163e8bd48cf8cd92f03e85ca6395"
-SRC_URI[sha256sum] = "df676f23dc6d4bfa384fc389d95dcd21ab907e6349d4c848958ba4befb73c73e"
-
-S = "${WORKDIR}/scons-${PV}"
-
-UPSTREAM_CHECK_URI = "http://scons.org/pages/download.html"
-UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
-
-inherit setuptools
-
-RDEPENDS_${PN} = "\
- python-fcntl \
- python-io \
- python-json \
- python-subprocess \
- python-shell \
- python-pprint \
- "
diff --git a/poky/meta/recipes-devtools/python/python-setuptools.inc b/poky/meta/recipes-devtools/python/python-setuptools.inc
index f49e07869..322197eed 100644
--- a/poky/meta/recipes-devtools/python/python-setuptools.inc
+++ b/poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -10,8 +10,8 @@ inherit pypi
SRC_URI_append_class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch"
-SRC_URI[md5sum] = "6404ca798bb9a9073aff3b91b2df35c8"
-SRC_URI[sha256sum] = "a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613"
+SRC_URI[md5sum] = "a3470ce184da33f0fa6c9f44f6221bc0"
+SRC_URI[sha256sum] = "66b86bbae7cc7ac2e867f52dc08a6bd064d938bac59dfec71b9b565dd36d6012"
DEPENDS += "${PYTHON_PN}"
diff --git a/poky/meta/recipes-devtools/python/python-setuptools_41.0.1.bb b/poky/meta/recipes-devtools/python/python-setuptools_41.2.0.bb
index cf9440495..cf9440495 100644
--- a/poky/meta/recipes-devtools/python/python-setuptools_41.0.1.bb
+++ b/poky/meta/recipes-devtools/python/python-setuptools_41.2.0.bb
diff --git a/poky/meta/recipes-devtools/python/python-testtools.inc b/poky/meta/recipes-devtools/python/python-testtools.inc
index 1011c98a3..d0b2e46d7 100644
--- a/poky/meta/recipes-devtools/python/python-testtools.inc
+++ b/poky/meta/recipes-devtools/python/python-testtools.inc
@@ -19,6 +19,7 @@ DEPENDS += " \
"
RDEPENDS_${PN} += "\
+ ${PYTHON_PN}-doctest \
${PYTHON_PN}-extras \
${PYTHON_PN}-pbr \
${PYTHON_PN}-six \
diff --git a/poky/meta/recipes-devtools/python/python.inc b/poky/meta/recipes-devtools/python/python.inc
index 779df5352..1462b779e 100644
--- a/poky/meta/recipes-devtools/python/python.inc
+++ b/poky/meta/recipes-devtools/python/python.inc
@@ -8,6 +8,12 @@ INC_PR = "r1"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e466242989bd33c1bd2b6a526a742498"
SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+ file://bpo-35907-cve-2019-9948.patch \
+ file://bpo-35907-cve-2019-9948-fix.patch \
+ file://bpo-36216-cve-2019-9636.patch \
+ file://bpo-36216-cve-2019-9636-fix.patch \
+ file://CVE-2019-9740.patch \
+ file://CVE-2018-20852.patch \
"
SRC_URI[md5sum] = "30157d85a2c0479c09ea2cbe61f2aaf5"
@@ -31,7 +37,6 @@ EXTRA_OECONF = "\
--enable-shared \
--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
- ${PYTHONLSBOPTS} \
"
do_configure_prepend() {
diff --git a/poky/meta/recipes-devtools/python/python/CVE-2018-20852.patch b/poky/meta/recipes-devtools/python/python/CVE-2018-20852.patch
new file mode 100644
index 000000000..23c784a21
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/CVE-2018-20852.patch
@@ -0,0 +1,123 @@
+From 979daae300916adb399ab5b51410b6ebd0888f13 Mon Sep 17 00:00:00 2001
+From: Xtreak <tir.karthi@gmail.com>
+Date: Sat, 15 Jun 2019 20:59:43 +0530
+Subject: [PATCH] [2.7] bpo-35121: prefix dot in domain for proper subdomain
+ validation (GH-10258) (GH-13426)
+
+This is a manual backport of ca7fe5063593958e5efdf90f068582837f07bd14 since 2.7 has `http.cookiejar` in `cookielib`
+
+
+https://bugs.python.org/issue35121
+CVE: CVE-2018-20852
+Upstream-Status: Backport [https://github.com/python/cpython/pull/13426]
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ Lib/cookielib.py | 13 ++++++--
+ Lib/test/test_cookielib.py | 30 +++++++++++++++++++
+ .../2019-05-20-00-35-12.bpo-35121.RRi-HU.rst | 4 +++
+ 3 files changed, 45 insertions(+), 2 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
+
+diff --git a/Lib/cookielib.py b/Lib/cookielib.py
+index 2dd7c48728e0..0b471a42f296 100644
+--- a/Lib/cookielib.py
++++ b/Lib/cookielib.py
+@@ -1139,6 +1139,11 @@ def return_ok_domain(self, cookie, request):
+ req_host, erhn = eff_request_host(request)
+ domain = cookie.domain
+
++ if domain and not domain.startswith("."):
++ dotdomain = "." + domain
++ else:
++ dotdomain = domain
++
+ # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
+ if (cookie.version == 0 and
+ (self.strict_ns_domain & self.DomainStrictNonDomain) and
+@@ -1151,7 +1156,7 @@ def return_ok_domain(self, cookie, request):
+ _debug(" effective request-host name %s does not domain-match "
+ "RFC 2965 cookie domain %s", erhn, domain)
+ return False
+- if cookie.version == 0 and not ("."+erhn).endswith(domain):
++ if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
+ _debug(" request-host %s does not match Netscape cookie domain "
+ "%s", req_host, domain)
+ return False
+@@ -1165,7 +1170,11 @@ def domain_return_ok(self, domain, request):
+ req_host = "."+req_host
+ if not erhn.startswith("."):
+ erhn = "."+erhn
+- if not (req_host.endswith(domain) or erhn.endswith(domain)):
++ if domain and not domain.startswith("."):
++ dotdomain = "." + domain
++ else:
++ dotdomain = domain
++ if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
+ #_debug(" request domain %s does not match cookie domain %s",
+ # req_host, domain)
+ return False
+diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py
+index f2dd9727d137..7f7ff614d61d 100644
+--- a/Lib/test/test_cookielib.py
++++ b/Lib/test/test_cookielib.py
+@@ -368,6 +368,7 @@ def test_domain_return_ok(self):
+ ("http://foo.bar.com/", ".foo.bar.com", True),
+ ("http://foo.bar.com/", "foo.bar.com", True),
+ ("http://foo.bar.com/", ".bar.com", True),
++ ("http://foo.bar.com/", "bar.com", True),
+ ("http://foo.bar.com/", "com", True),
+ ("http://foo.com/", "rhubarb.foo.com", False),
+ ("http://foo.com/", ".foo.com", True),
+@@ -378,6 +379,8 @@ def test_domain_return_ok(self):
+ ("http://foo/", "foo", True),
+ ("http://foo/", "foo.local", True),
+ ("http://foo/", ".local", True),
++ ("http://barfoo.com", ".foo.com", False),
++ ("http://barfoo.com", "foo.com", False),
+ ]:
+ request = urllib2.Request(url)
+ r = pol.domain_return_ok(domain, request)
+@@ -938,6 +941,33 @@ def test_domain_block(self):
+ c.add_cookie_header(req)
+ self.assertFalse(req.has_header("Cookie"))
+
++ c.clear()
++
++ pol.set_blocked_domains([])
++ req = Request("http://acme.com/")
++ res = FakeResponse(headers, "http://acme.com/")
++ cookies = c.make_cookies(res, req)
++ c.extract_cookies(res, req)
++ self.assertEqual(len(c), 1)
++
++ req = Request("http://acme.com/")
++ c.add_cookie_header(req)
++ self.assertTrue(req.has_header("Cookie"))
++
++ req = Request("http://badacme.com/")
++ c.add_cookie_header(req)
++ self.assertFalse(pol.return_ok(cookies[0], req))
++ self.assertFalse(req.has_header("Cookie"))
++
++ p = pol.set_blocked_domains(["acme.com"])
++ req = Request("http://acme.com/")
++ c.add_cookie_header(req)
++ self.assertFalse(req.has_header("Cookie"))
++
++ req = Request("http://badacme.com/")
++ c.add_cookie_header(req)
++ self.assertFalse(req.has_header("Cookie"))
++
+ def test_secure(self):
+ from cookielib import CookieJar, DefaultCookiePolicy
+
+diff --git a/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst b/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
+new file mode 100644
+index 000000000000..77251806163b
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
+@@ -0,0 +1,4 @@
++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
++:class:`cookielib.DefaultCookiePolicy` policy. Patch by Karthikeyan
++Singaravelan.
diff --git a/poky/meta/recipes-devtools/python/python/CVE-2019-9740.patch b/poky/meta/recipes-devtools/python/python/CVE-2019-9740.patch
new file mode 100644
index 000000000..95f43e038
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/CVE-2019-9740.patch
@@ -0,0 +1,216 @@
+From bb8071a4cae5ab3fe321481dd3d73662ffb26052 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner@gmail.com>
+Date: Tue, 21 May 2019 15:12:33 +0200
+Subject: [PATCH] bpo-30458: Disallow control chars in http URLs (GH-12755)
+ (GH-13154) (GH-13315)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Disallow control chars in http URLs in urllib2.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 httplib.InvalidURL instead of ValueError as the new error case's
+exception. (GH-13044)
+
+Backport Co-Authored-By: Miro HronĨok <miro@hroncok.cz>
+
+(cherry picked from commit 7e200e0763f5b71c199aaf98bd5588f291585619)
+
+Notes on backport to Python 2.7:
+
+* test_urllib tests urllib.urlopen() which quotes the URL and so is
+ not vulerable to HTTP Header Injection.
+* Add tests to test_urllib2 on urllib2.urlopen().
+* Reject non-ASCII characters: range 0x80-0xff.
+
+Upstream-Status: Backport
+CVE: CVE-2019-9740
+CVE: CVE-2019-9947
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ Lib/httplib.py | 16 ++++++
+ Lib/test/test_urllib.py | 25 +++++++++
+ Lib/test/test_urllib2.py | 51 ++++++++++++++++++-
+ Lib/test/test_xmlrpc.py | 8 ++-
+ .../2019-04-10-08-53-30.bpo-30458.51E-DA.rst | 1 +
+ 5 files changed, 99 insertions(+), 2 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
+
+diff --git a/Lib/httplib.py b/Lib/httplib.py
+index 60a8fb4e355f..1b41c346e090 100644
+--- a/Lib/httplib.py
++++ b/Lib/httplib.py
+@@ -247,6 +247,16 @@
+ _is_legal_header_name = re.compile(r'\A[^:\s][^:\r\n]*\Z').match
+ _is_illegal_header_value = re.compile(r'\n(?![ \t])|\r(?![ \t\n])').search
+
++# These characters are not allowed within HTTP URL paths.
++# See https://tools.ietf.org/html/rfc3986#section-3.3 and the
++# https://tools.ietf.org/html/rfc3986#appendix-A pchar definition.
++# Prevents CVE-2019-9740. Includes control characters such as \r\n.
++# Restrict non-ASCII characters above \x7f (0x80-0xff).
++_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f-\xff]')
++# Arguably only these _should_ allowed:
++# _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")
++# We are more lenient for assumed real world compatibility purposes.
++
+ # We always set the Content-Length header for these methods because some
+ # servers will otherwise respond with a 411
+ _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}
+@@ -927,6 +937,12 @@ def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
+ self._method = method
+ if not url:
+ url = '/'
++ # Prevent CVE-2019-9740.
++ match = _contains_disallowed_url_pchar_re.search(url)
++ if match:
++ raise InvalidURL("URL can't contain control characters. %r "
++ "(found at least %r)"
++ % (url, match.group()))
+ hdr = '%s %s %s' % (method, url, self._http_vsn_str)
+
+ self._output(hdr)
+diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
+index 1ce9201c0693..d7778d4194f3 100644
+--- a/Lib/test/test_urllib.py
++++ b/Lib/test/test_urllib.py
+@@ -257,6 +257,31 @@ def test_url_fragment(self):
+ finally:
+ self.unfakehttp()
+
++ def test_url_with_control_char_rejected(self):
++ for char_no in range(0, 0x21) + range(0x7f, 0x100):
++ char = chr(char_no)
++ schemeless_url = "//localhost:7777/test%s/" % char
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ try:
++ # urllib quotes the URL so there is no injection.
++ resp = urllib.urlopen("http:" + schemeless_url)
++ self.assertNotIn(char, resp.geturl())
++ finally:
++ self.unfakehttp()
++
++ def test_url_with_newline_header_injection_rejected(self):
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
++ schemeless_url = "//" + host + ":8080/test/?test=a"
++ try:
++ # urllib quotes the URL so there is no injection.
++ resp = urllib.urlopen("http:" + schemeless_url)
++ self.assertNotIn(' ', resp.geturl())
++ self.assertNotIn('\r', resp.geturl())
++ self.assertNotIn('\n', resp.geturl())
++ finally:
++ self.unfakehttp()
++
+ def test_read_bogus(self):
+ # urlopen() should raise IOError for many error codes.
+ self.fakehttp('''HTTP/1.1 401 Authentication Required
+diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
+index 6d24d5ddf83c..9531818e16b2 100644
+--- a/Lib/test/test_urllib2.py
++++ b/Lib/test/test_urllib2.py
+@@ -15,6 +15,9 @@
+ except ImportError:
+ ssl = None
+
++from test.test_urllib import FakeHTTPMixin
++
++
+ # XXX
+ # Request
+ # CacheFTPHandler (hard to write)
+@@ -1262,7 +1265,7 @@ def _test_basic_auth(self, opener, auth_handler, auth_header,
+ self.assertEqual(len(http_handler.requests), 1)
+ self.assertFalse(http_handler.requests[0].has_header(auth_header))
+
+-class MiscTests(unittest.TestCase):
++class MiscTests(unittest.TestCase, FakeHTTPMixin):
+
+ def test_build_opener(self):
+ class MyHTTPHandler(urllib2.HTTPHandler): pass
+@@ -1317,6 +1320,52 @@ def test_unsupported_algorithm(self):
+ "Unsupported digest authentication algorithm 'invalid'"
+ )
+
++ @unittest.skipUnless(ssl, "ssl module required")
++ def test_url_with_control_char_rejected(self):
++ for char_no in range(0, 0x21) + range(0x7f, 0x100):
++ char = chr(char_no)
++ schemeless_url = "//localhost:7777/test%s/" % char
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ try:
++ # We explicitly test urllib.request.urlopen() instead of the top
++ # level 'def urlopen()' function defined in this... (quite ugly)
++ # test suite. They use different url opening codepaths. Plain
++ # urlopen uses FancyURLOpener which goes via a codepath that
++ # calls urllib.parse.quote() on the URL which makes all of the
++ # above attempts at injection within the url _path_ safe.
++ escaped_char_repr = repr(char).replace('\\', r'\\')
++ InvalidURL = httplib.InvalidURL
++ with self.assertRaisesRegexp(
++ InvalidURL, "contain control.*" + escaped_char_repr):
++ urllib2.urlopen("http:" + schemeless_url)
++ with self.assertRaisesRegexp(
++ InvalidURL, "contain control.*" + escaped_char_repr):
++ urllib2.urlopen("https:" + schemeless_url)
++ finally:
++ self.unfakehttp()
++
++ @unittest.skipUnless(ssl, "ssl module required")
++ def test_url_with_newline_header_injection_rejected(self):
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
++ schemeless_url = "//" + host + ":8080/test/?test=a"
++ try:
++ # We explicitly test urllib2.urlopen() instead of the top
++ # level 'def urlopen()' function defined in this... (quite ugly)
++ # test suite. They use different url opening codepaths. Plain
++ # urlopen uses FancyURLOpener which goes via a codepath that
++ # calls urllib.parse.quote() on the URL which makes all of the
++ # above attempts at injection within the url _path_ safe.
++ InvalidURL = httplib.InvalidURL
++ with self.assertRaisesRegexp(
++ InvalidURL, r"contain control.*\\r.*(found at least . .)"):
++ urllib2.urlopen("http:" + schemeless_url)
++ with self.assertRaisesRegexp(InvalidURL, r"contain control.*\\n"):
++ urllib2.urlopen("https:" + schemeless_url)
++ finally:
++ self.unfakehttp()
++
++
+
+ class RequestTests(unittest.TestCase):
+
+diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
+index 36b3be67fd6b..90ccb30716ff 100644
+--- a/Lib/test/test_xmlrpc.py
++++ b/Lib/test/test_xmlrpc.py
+@@ -659,7 +659,13 @@ def test_dotted_attribute(self):
+ def test_partial_post(self):
+ # Check that a partial POST doesn't make the server loop: issue #14001.
+ conn = httplib.HTTPConnection(ADDR, PORT)
+- conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
++ conn.send('POST /RPC2 HTTP/1.0\r\n'
++ 'Content-Length: 100\r\n\r\n'
++ 'bye HTTP/1.1\r\n'
++ 'Host: %s:%s\r\n'
++ 'Accept-Encoding: identity\r\n'
++ 'Content-Length: 0\r\n\r\n'
++ % (ADDR, PORT))
+ conn.close()
+
+ class SimpleServerEncodingTestCase(BaseServerTestCase):
+diff --git a/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
+new file mode 100644
+index 000000000000..47cb899df1af
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
+@@ -0,0 +1 @@
++Address CVE-2019-9740 by disallowing URL paths with embedded whitespace or control characters through into the underlying http client request. Such potentially malicious header injection URLs now cause an httplib.InvalidURL exception to be raised.
diff --git a/poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb b/poky/meta/recipes-devtools/python/python3-dbus_1.2.12.bb
index c9bf8df42..d005dc4a9 100644
--- a/poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb
+++ b/poky/meta/recipes-devtools/python/python3-dbus_1.2.12.bb
@@ -3,13 +3,13 @@ SECTION = "devel/python"
HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=b03240518994df6d8c974675675e5ca4"
-DEPENDS = "expat dbus dbus-glib virtual/libintl"
+DEPENDS = "expat dbus glib-2.0 virtual/libintl"
-SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
-"
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "428b7a9e7e2d154a7ceb3e13536283e4"
+SRC_URI[sha256sum] = "cdd4de2c4f5e58f287b12013ed7b41dee81d503c8d0d2397c5bd2fb01badf260"
-SRC_URI[md5sum] = "7379db774c10904f27e7e2743d90fb43"
-SRC_URI[sha256sum] = "abf12bbb765e300bf8e2a1b2f32f85949eab06998dbda127952c31cb63957b6f"
S = "${WORKDIR}/dbus-python-${PV}"
inherit distutils3-base autotools pkgconfig
@@ -22,3 +22,5 @@ EXTRA_OECONF += "--disable-documentation"
RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml"
FILES_${PN}-dev += "${libdir}/pkgconfig"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb b/poky/meta/recipes-devtools/python/python3-docutils_0.15.bb
index 81a449d64..f5c3f5d70 100644
--- a/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
+++ b/poky/meta/recipes-devtools/python/python3-docutils_0.15.bb
@@ -7,12 +7,11 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=35a23d42b615470583563132872c97d6"
DEPENDS = "python3"
SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
-SRC_URI[md5sum] = "c53768d63db3873b7d452833553469de"
-SRC_URI[sha256sum] = "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274"
+SRC_URI[md5sum] = "f51729f19e70a9dc4837433193a5e798"
+SRC_URI[sha256sum] = "c35e87e985f70106f6f97e050f3bed990641e0e104566134b9cd23849a460e96"
S = "${WORKDIR}/docutils-${PV}"
inherit distutils3
BBCLASSEXTEND = "native"
-
diff --git a/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb b/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb
deleted file mode 100644
index ac320fa56..000000000
--- a/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require python-git.inc
-inherit setuptools3
diff --git a/poky/meta/recipes-devtools/python/python-git.inc b/poky/meta/recipes-devtools/python/python3-git_3.0.2.bb
index f973e9f42..9dd753db4 100644
--- a/poky/meta/recipes-devtools/python/python-git.inc
+++ b/poky/meta/recipes-devtools/python/python3-git_3.0.2.bb
@@ -10,12 +10,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
PYPI_PACKAGE = "GitPython"
-inherit pypi
+inherit pypi setuptools3
-SRC_URI[md5sum] = "cee43a39a1468084d49d1c49fb675204"
-SRC_URI[sha256sum] = "8237dc5bfd6f1366abeee5624111b9d6879393d84745a507de0fda86043b65a8"
+SRC_URI[md5sum] = "ccec14a5c9f18702406122983d80032c"
+SRC_URI[sha256sum] = "d2f4945f8260f6981d724f5957bc076398ada55cb5d25aaee10108bcdc894100"
-DEPENDS = "${PYTHON_PN}-gitdb"
+DEPENDS += " ${PYTHON_PN}-gitdb"
RDEPENDS_${PN} += " \
${PYTHON_PN}-datetime \
@@ -29,4 +29,5 @@ RDEPENDS_${PN} += " \
${PYTHON_PN}-unixadmin \
git \
"
+
BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-mako_1.0.10.bb b/poky/meta/recipes-devtools/python/python3-mako_1.0.10.bb
deleted file mode 100644
index 17803f1b0..000000000
--- a/poky/meta/recipes-devtools/python/python3-mako_1.0.10.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-inherit setuptools3
-require python-mako.inc
-
diff --git a/poky/meta/recipes-devtools/python/python-mako.inc b/poky/meta/recipes-devtools/python/python3-mako_1.1.0.bb
index 20808fe5a..b139e5ab0 100644
--- a/poky/meta/recipes-devtools/python/python-mako.inc
+++ b/poky/meta/recipes-devtools/python/python3-mako_1.1.0.bb
@@ -2,14 +2,14 @@ SUMMARY = "Templating library for Python"
HOMEPAGE = "http://www.makotemplates.org/"
SECTION = "devel/python"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1bb21fa2d2f7a534c884b990430a6863"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df7e6c7c82990acf0228a55e00d29bc9"
PYPI_PACKAGE = "Mako"
-inherit pypi
+inherit pypi setuptools3
-SRC_URI[md5sum] = "a94d376078dda65f834ea5049a81ebb5"
-SRC_URI[sha256sum] = "7165919e78e1feb68b4dbe829871ea9941398178fa58e6beedb9ba14acf63965"
+SRC_URI[md5sum] = "6c3f2da0b74af529a4c4a537d0848bf2"
+SRC_URI[sha256sum] = "a36919599a9b7dc5d86a7a8988f23a9a3a3d083070023bab23d64f7f1d1e0a4b"
RDEPENDS_${PN} = "${PYTHON_PN}-html \
${PYTHON_PN}-netclient \
diff --git a/poky/meta/recipes-devtools/python/python3-pbr_5.2.0.bb b/poky/meta/recipes-devtools/python/python3-pbr_5.2.0.bb
deleted file mode 100644
index ed6832e4a..000000000
--- a/poky/meta/recipes-devtools/python/python3-pbr_5.2.0.bb
+++ /dev/null
@@ -1,5 +0,0 @@
-inherit setuptools3
-require python-pbr.inc
-SRC_URI[md5sum] = "2bca008fd08d035a2f78c606d876a6db"
-SRC_URI[sha256sum] = "d950c64aeea5456bbd147468382a5bb77fe692c13c9f00f0219814ce5b642755"
-
diff --git a/poky/meta/recipes-devtools/python/python3-pbr_5.4.3.bb b/poky/meta/recipes-devtools/python/python3-pbr_5.4.3.bb
new file mode 100644
index 000000000..e7835e7a9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pbr_5.4.3.bb
@@ -0,0 +1,5 @@
+inherit setuptools3
+require python-pbr.inc
+
+SRC_URI[md5sum] = "477d2aa285ad97250a172b199f4060b7"
+SRC_URI[sha256sum] = "2c8e420cd4ed4cec4e7999ee47409e876af575d4c35a45840d59e8b5f3155ab8"
diff --git a/poky/meta/recipes-devtools/python/python3-pip_19.1.1.bb b/poky/meta/recipes-devtools/python/python3-pip_19.2.3.bb
index baf32f472..019e327e0 100644
--- a/poky/meta/recipes-devtools/python/python3-pip_19.1.1.bb
+++ b/poky/meta/recipes-devtools/python/python3-pip_19.2.3.bb
@@ -6,8 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8ba06d529c955048e5ddd7c45459eb2e"
DEPENDS += "python3 python3-setuptools-native"
-SRC_URI[md5sum] = "4fb98a060f21c731d6743b90a714fc73"
-SRC_URI[sha256sum] = "44d3d7d3d30a1eb65c7e5ff1173cdf8f7467850605ac7cc3707b6064bddd0958"
+SRC_URI[md5sum] = "f417444c66a0db1a82c8d9d2283a2f95"
+SRC_URI[sha256sum] = "e7a31f147974362e6c82d84b91c7f2bdf57e4d3163d3d454e6c3e71944d67135"
inherit pypi distutils3
@@ -25,6 +25,7 @@ RDEPENDS_${PN} = "\
python3-setuptools \
python3-unixadmin \
python3-xmlrpc \
+ python3-pickle \
"
BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-pygobject_3.32.1.bb b/poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb
index 8eda06e9e..6babf0cae 100644
--- a/poky/meta/recipes-devtools/python/python3-pygobject_3.32.1.bb
+++ b/poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb
@@ -9,25 +9,25 @@ inherit gnomebase distutils3-base gobject-introspection upstream-version-is-even
DEPENDS += "python3 glib-2.0"
SRCNAME="pygobject"
+
SRC_URI = " \
http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
file://0001-Do-not-build-tests.patch \
"
+SRC_URI[md5sum] = "ca1dc4f31c1d6d283758e8f315a88ab6"
+SRC_URI[sha256sum] = "87e2c9aa785f352ef111dcc5f63df9b85cf6e05e52ff04f803ffbebdacf5271a"
UNKNOWN_CONFIGURE_WHITELIST = "introspection"
-SRC_URI[md5sum] = "9d5dbca10162dd9b0d03fed0c6cf865d"
-SRC_URI[sha256sum] = "32c99def94b8dea5ce9e4bc99576ef87591ea779b4db77cfdca7af81b76d04d8"
-
S = "${WORKDIR}/${SRCNAME}-${PV}"
PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+RDEPENDS_${PN} += "python3-pkgutil"
+
# python3-pycairo is checked on configuration -> DEPENDS
# we don't link against python3-pycairo -> RDEPENDS
PACKAGECONFIG[cairo] = "-Dpycairo=true,-Dpycairo=false, cairo python3-pycairo, python3-pycairo"
-RDEPENDS_${PN} += "python3-setuptools"
-
BBCLASSEXTEND = "native"
PACKAGECONFIG_class-native = ""
diff --git a/poky/meta/recipes-devtools/python/python3-scons-native_3.0.5.bb b/poky/meta/recipes-devtools/python/python3-scons-native_3.1.1.bb
index 5cd595662..5cd595662 100644
--- a/poky/meta/recipes-devtools/python/python3-scons-native_3.0.5.bb
+++ b/poky/meta/recipes-devtools/python/python3-scons-native_3.1.1.bb
diff --git a/poky/meta/recipes-devtools/python/python3-scons_3.0.5.bb b/poky/meta/recipes-devtools/python/python3-scons_3.1.1.bb
index 7fb75a627..0c7aaeaee 100644
--- a/poky/meta/recipes-devtools/python/python3-scons_3.0.5.bb
+++ b/poky/meta/recipes-devtools/python/python3-scons_3.1.1.bb
@@ -4,8 +4,8 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=37bb53a08e6beaea0c90e7821d731284"
SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
-SRC_URI[md5sum] = "9f9c163e8bd48cf8cd92f03e85ca6395"
-SRC_URI[sha256sum] = "df676f23dc6d4bfa384fc389d95dcd21ab907e6349d4c848958ba4befb73c73e"
+SRC_URI[md5sum] = "35b2a3993313bbedd221d4d5758fd2fd"
+SRC_URI[sha256sum] = "4cea417fdd7499a36f407923d03b4b7000b0f9e8fd7b31b316b9ce7eba9143a5"
S = "${WORKDIR}/scons-${PV}"
diff --git a/poky/meta/recipes-devtools/python/python3-setuptools_41.0.1.bb b/poky/meta/recipes-devtools/python/python3-setuptools_41.2.0.bb
index 0dc1ed862..0dc1ed862 100644
--- a/poky/meta/recipes-devtools/python/python3-setuptools_41.0.1.bb
+++ b/poky/meta/recipes-devtools/python/python3-setuptools_41.2.0.bb
diff --git a/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb b/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
index 2ece4451d..55066e2d0 100644
--- a/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
+++ b/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
@@ -1,2 +1,4 @@
inherit setuptools3
require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch b/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
new file mode 100644
index 000000000..957839bf3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
@@ -0,0 +1,35 @@
+From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
+From: Inada Naoki <songofacandy@gmail.com>
+Date: Sat, 14 Jul 2018 00:46:11 +0900
+Subject: [PATCH] Use FLAG_REF always for interned strings
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226]
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+---
+ Python/marshal.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Python/marshal.c b/Python/marshal.c
+index 6d06266c6a..51db2e3b2e 100644
+--- a/Python/marshal.c
++++ b/Python/marshal.c
+@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
+ if (p->version < 3 || p->hashtable == NULL)
+ return 0; /* not writing object references */
+
+- /* if it has only one reference, it definitely isn't shared */
+- if (Py_REFCNT(v) == 1)
++ /* If it has only one reference, it definitely isn't shared.
++ * But we use TYPE_REF always for interned string, to PYC file stable
++ * as possible.
++ */
++ if (Py_REFCNT(v) == 1 &&
++ !(PyUnicode_CheckExact(v) && PyUnicode_CHECK_INTERNED(v))) {
+ return 0;
++ }
+
+ entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
+ if (entry != NULL) {
+--
+2.21.0
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch b/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
new file mode 100644
index 000000000..35b7e0c48
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
@@ -0,0 +1,46 @@
+From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 5 Aug 2019 15:57:39 +0800
+Subject: [PATCH] test_locale.py: correct the test output format
+
+Before this patch:
+ # python3 -m test -v test_locale
+ [snip]
+ test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9') ok
+ [snip]
+
+ After this patch:
+ # python3 -m test -v test_locale
+ [snip]
+ test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9')... ok
+ [snip]
+
+ Make the test ended with "... ok" is common in python
+ unittest world, we should make it keep consistent
+ with other test cases in case it may be ignored to
+ record in the report if we use the common filter
+ "... ok".
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ Lib/test/test_locale.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
+index e2c2178..558d63c 100644
+--- a/Lib/test/test_locale.py
++++ b/Lib/test/test_locale.py
+@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
+ self.skipTest('test needs Turkish locale')
+ loc = locale.getlocale(locale.LC_CTYPE)
+ if verbose:
+- print('testing with %a' % (loc,), end=' ', flush=True)
++ print('testing with %a...' % (loc,), end=' ', flush=True)
+ locale.setlocale(locale.LC_CTYPE, loc)
+ self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
index 35213171b..0bafec73c 100644
--- a/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
+++ b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -1,4 +1,4 @@
-From 12900d498bb77bcc990868a80eaf0ab257b88fff Mon Sep 17 00:00:00 2001
+From 6229502e5ae6cbb22240594f002638e9ef78f831 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 14 May 2013 15:00:26 -0700
Subject: [PATCH] python3: Add target and native recipes
@@ -14,36 +14,40 @@ Upstream-Status: Inappropriate [embedded specific]
# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
---
- Lib/distutils/sysconfig.py | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ Lib/distutils/sysconfig.py | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 6b8c129..3ca7f79 100644
+index 3dfd0a3..6c6b09a 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+@@ -97,7 +97,9 @@ def get_python_inc(plat_specific=0, prefix=None):
If 'prefix' is supplied, use it instead of sys.base_prefix or
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
"""
- if prefix is None:
-+ if prefix is None and os.environ['STAGING_INCDIR'] != "":
++ if prefix is None and os.environ.get('STAGING_INCDIR', ""):
+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
+ elif prefix is None:
prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
if os.name == "posix":
if python_build:
-@@ -122,6 +124,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+@@ -140,7 +142,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
If 'prefix' is supplied, use it instead of sys.base_prefix or
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
"""
-+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
-+ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
+- if prefix is None:
++ if os.environ.get('STAGING_LIBDIR', ""):
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++ else:
++ lib_basename = "lib"
++ if prefix is None and os.environ.get('STAGING_LIBDIR', ""):
+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
-+
- if prefix is None:
++ elif prefix is None:
if standard_lib:
prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
-@@ -130,7 +136,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ else:
+@@ -148,7 +156,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
if os.name == "posix":
libpython = os.path.join(prefix,
diff --git a/poky/meta/recipes-devtools/python/python3/python3-manifest.json b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
index 0803ac003..1ad85a9ff 100644
--- a/poky/meta/recipes-devtools/python/python3/python3-manifest.json
+++ b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -115,7 +115,7 @@
"cached": []
},
"asyncio": {
- "summary": "Python Asynchronous I/",
+ "summary": "Python Asynchronous I/O",
"rdepends": [
"core",
"io",
@@ -291,6 +291,7 @@
"${libdir}/python${PYTHON_MAJMIN}/re.py",
"${libdir}/python${PYTHON_MAJMIN}/reprlib.py",
"${libdir}/python${PYTHON_MAJMIN}/rlcompleter.py",
+ "${libdir}/python${PYTHON_MAJMIN}/runpy.py",
"${libdir}/python${PYTHON_MAJMIN}/selectors.py",
"${libdir}/python${PYTHON_MAJMIN}/signal.py",
"${libdir}/python${PYTHON_MAJMIN}/site.py",
@@ -355,6 +356,7 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/re.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/reprlib.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/rlcompleter.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/runpy.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/selectors.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/signal.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/site.*.pyc",
@@ -512,17 +514,15 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/difflib.*.pyc"
]
},
- "distutils-staticdev": {
- "cached": [
- "${libdir}/python${PYTHON_MAJMIN}/config/__pycache__/lib*.a"
- ],
+ "distutils-windows": {
+ "cached": [],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/config/lib*.a"
+ "${libdir}/python${PYTHON_MAJMIN}/distutils/command/wininst-*.exe"
],
"rdepends": [
"distutils"
],
- "summary": "Python distribution utilities (static libraries)"
+ "summary": "Python distribution utilities (Windows installer stubs)"
},
"distutils": {
"summary": "Python Distribution Utilities",
@@ -785,7 +785,6 @@
"profile",
"pydoc",
"resource",
- "runpy",
"shell",
"smtpd",
"sqlite3",
@@ -801,6 +800,9 @@
"xml",
"xmlrpc"
],
+ "rrecommends": [
+ "distutils-windows"
+ ],
"summary": "All Python modules"
},
"multiprocessing": {
@@ -1004,19 +1006,6 @@
],
"cached": []
},
- "runpy": {
- "summary": "Python helper for locating/executing scripts in module namespace",
- "rdepends": [
- "core",
- "pkgutil"
- ],
- "files": [
- "${libdir}/python${PYTHON_MAJMIN}/runpy.py"
- ],
- "cached": [
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/runpy.*.pyc"
- ]
- },
"shell": {
"summary": "Python shell-like functionality",
"rdepends": [
diff --git a/poky/meta/recipes-devtools/python/python3_3.7.3.bb b/poky/meta/recipes-devtools/python/python3_3.7.4.bb
index 3409d94ba..8693c446c 100644
--- a/poky/meta/recipes-devtools/python/python3_3.7.3.bb
+++ b/poky/meta/recipes-devtools/python/python3_3.7.4.bb
@@ -26,6 +26,8 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \
file://crosspythonpath.patch \
file://reformat_sysconfig.py \
+ file://0001-Use-FLAG_REF-always-for-interned-strings.patch \
+ file://0001-test_locale.py-correct-the-test-output-format.patch \
"
SRC_URI_append_class-native = " \
@@ -36,8 +38,8 @@ SRC_URI_append_class-nativesdk = " \
file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \
"
-SRC_URI[md5sum] = "93df27aec0cd18d6d42173e601ffbbfd"
-SRC_URI[sha256sum] = "da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318"
+SRC_URI[md5sum] = "d33e4aae66097051c2eca45ee3604803"
+SRC_URI[sha256sum] = "fb799134b868199930b75f26678f18932214042639cd52b16da7fd134cd9b13f"
# exclude pre-releases for both python 2.x and 3.x
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
@@ -228,7 +230,7 @@ python(){
newpackages=[]
for key in python_manifest:
- pypackage= pn + '-' + key
+ pypackage = pn + '-' + key
if pypackage not in packages:
# We need to prepend, otherwise python-misc gets everything
@@ -248,8 +250,14 @@ python(){
for value in python_manifest[key]['rdepends']:
# Make it work with or without $PN
if '${PN}' in value:
- value=value.split('-')[1]
+ value=value.split('-', 1)[1]
d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+
+ for value in python_manifest[key].get('rrecommends', ()):
+ if '${PN}' in value:
+ value=value.split('-', 1)[1]
+ d.appendVar('RRECOMMENDS_' + pypackage, ' ' + pn + '-' + value)
+
d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
# Prepending so to avoid python-misc getting everything
@@ -302,7 +310,7 @@ INSANE_SKIP_${PN}-dev += "dev-elf"
# catch all the rest (unsorted)
PACKAGES += "${PN}-misc"
-RDEPENDS_${PN}-misc += "python3-core python3-email python3-codecs"
+RDEPENDS_${PN}-misc += "python3-core python3-email python3-codecs python3-pydoc python3-pickle"
RDEPENDS_${PN}-modules_append_class-target = " python3-misc"
RDEPENDS_${PN}-modules_append_class-nativesdk = " python3-misc"
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN} ${libdir}/python${PYTHON_MAJMIN}/lib-dynload"
@@ -313,6 +321,6 @@ FILES_${PN}-man = "${datadir}/man"
RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2 libgcc tzdata-europe coreutils sed"
RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-tr-tr.iso-8859-9"
-RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
+RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}"
RDEPENDS_${PN}-dev = ""
diff --git a/poky/meta/recipes-devtools/python/python_2.7.16.bb b/poky/meta/recipes-devtools/python/python_2.7.16.bb
index 5f387b8af..5b856a509 100644
--- a/poky/meta/recipes-devtools/python/python_2.7.16.bb
+++ b/poky/meta/recipes-devtools/python/python_2.7.16.bb
@@ -30,10 +30,6 @@ SRC_URI += " \
file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \
file://float-endian.patch \
file://0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch \
- file://bpo-35907-cve-2019-9948.patch \
- file://bpo-35907-cve-2019-9948-fix.patch \
- file://bpo-36216-cve-2019-9636.patch \
- file://bpo-36216-cve-2019-9636-fix.patch \
"
S = "${WORKDIR}/Python-${PV}"
@@ -177,7 +173,7 @@ RDEPENDS_${PN}-modules += "${PN}-misc"
# ptest
RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip tzdata-europe coreutils sed"
-RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
+RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}"
# catch manpage
PACKAGES += "${PN}-man"
FILES_${PN}-man = "${datadir}/man"