8000 Merge C-Python 3.5.7 into branch 3.5-slp · stackless-dev/stackless@cc30588 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit cc30588

Browse files
author
Anselm Kruis
committed
Merge C-Python 3.5.7 into branch 3.5-slp
2 parents 321104d + 1917d9b commit cc30588

26 files changed

+441
-13156
lines changed

Doc/copyright.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright
44

55
Python and this documentation is:
66

7-
Copyright © 2001-2018 Python Software Foundation. All rights reserved.
7+
Copyright © 2001-2019 Python Software Foundation. All rights reserved.
88

99
Copyright © 2000 BeOpen.com. All rights reserved.
1010

Doc/library/urllib.parse.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ or on combining URL components into a URL string.
120120
Unmatched square brackets in the :attr:`netloc` attribute will raise a
121121
:exc:`ValueError`.
122122

123+
Characters in the :attr:`netloc` attribute that decompose under NFKC
124+
normalization (as used by the IDNA encoding) into any of ``/``, ``?``,
125+
``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is
126+
decomposed before parsing, no error will be raised.
127+
123128
.. versionchanged:: 3.2
124129
Added IPv6 URL parsing capabilities.
125130

@@ -128,6 +133,10 @@ or on combining URL components into a URL string.
128133
false), in accordance with :rfc:`3986`. Previously, a whitelist of
129134
schemes that support fragments existed.
130135

136+
.. versionchanged:: 3.5.7
137+
Characters that affect netloc parsing under NFKC normalization will
138+
now raise :exc:`ValueError`.
139+
131140

132141
.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
133142

@@ -236,6 +245,15 @@ or on combining URL components into a URL string.
236245
Unmatched square brackets in the :attr:`netloc` attribute will raise a
237246
:exc:`ValueError`.
238247

248+
Characters in the :attr:`netloc` attribute that decompose under NFKC
249+
normalization (as used by the IDNA encoding) into any of ``/``, ``?``,
250+
``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is
251+
decomposed before parsing, no error will be raised.
252+
253+
.. versionchanged:: 3.5.7
254+
Characters that affect netloc parsing under NFKC normalization will
255+
now raise :exc:`ValueError`.
256+
239257

240258
.. function:: urlunsplit(parts)
241259

Doc/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ PSF LICENSE AGREEMENT FOR PYTHON |release|
8787
analyze, test, perform and/or display publicly, prepare derivative works,
8888
distribute, and otherwise use Python |release| alone or in any derivative
8989
version, provided, however, that PSF's License Agreement and PSF's notice of
90-
copyright, i.e., "Copyright © 2001-2018 Python Software Foundation; All Rights
90+
copyright, i.e., "Copyright © 2001-2019 Python Software Foundation; All Rights
9191
Reserved" are retained in Python |release| alone or in any derivative version
9292
prepared by Licensee.
9393

Include/patchlevel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
/*--start constants--*/
1919
#define PY_MAJOR_VERSION 3
2020
#define PY_MINOR_VERSION 5
21-
#define PY_MICRO_VERSION 6
21+
#define PY_MICRO_VERSION 7
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
2323
#define PY_RELEASE_SERIAL 0
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.5.6"
26+
#define PY_VERSION "3.5.7"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

Include/pyexpat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* note: you must import expat.h before importing this module! */
55

6-
#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
6+
#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
77
#define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
88

99
struct PyExpat_CAPI
@@ -48,6 +48,8 @@ struct PyExpat_CAPI
4848
enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding);
4949
int (*DefaultUnknownEncodingHandler)(
5050
void *encodingHandlerData, const XML_Char *name, XML_Encoding *info);
51+
/* might be none for expat < 2.1.0 */
52+
int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
5153
/* always add new stuff to the end! */
5254
};
5355

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ analyze, test, perform and/or display publicly, prepare derivative works,
7373
distribute, and otherwise use Python alone or in any derivative version,
7474
provided, however, that PSF's License Agreement and PSF's notice of copyright,
7575
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
76-
2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Python Software
76+
2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software
7777
Foundation; All Rights Reserved" are retained in Python alone or in any
7878
derivative version prepared by Licensee.
7979

Lib/http/cookiejar.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ def set_ok_path(self, cookie, request):
993993
req_path = request_path(request)
994994
if ((cookie.version > 0 or
995995
(cookie.version == 0 and self.strict_ns_set_path)) and
996-
not req_path.startswith(cookie.path)):
996+
not self.path_return_ok(cookie.path, request)):
997997
_debug(" path attribute %s is not a prefix of request "
998998
"path %s", cookie.path, req_path)
999999
return False
@@ -1148,6 +1148,11 @@ def return_ok_domain(self, cookie, request):
11481148
req_host, erhn = eff_request_host(request)
11491149
domain = cookie.domain
11501150

1151+
if domain and not domain.startswith("."):
1152+
dotdomain = "." + domain
1153+
else:
1154+
dotdomain = domain
1155+
11511156
# strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
11521157
if (cookie.version == 0 and
11531158
(self.strict_ns_domain & self.DomainStrictNonDomain) and
@@ -1160,7 +1165,7 @@ def return_ok_domain(self, cookie, request):
11601165
_debug(" effective request-host name %s does not domain-match "
11611166
"RFC 2965 cookie domain %s", erhn, domain)
11621167
return False
1163-
if cookie.version == 0 and not ("."+erhn).endswith(domain):
1168+
if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
11641169
_debug(" request-host %s does not match Netscape cookie domain "
11651170
"%s", req_host, domain)
11661171
return False
@@ -1174,7 +1179,11 @@ def domain_return_ok(self, domain, request):
11741179
req_host = "."+req_host
11751180
if not erhn.startswith("."):
11761181
erhn = "."+erhn
1177-
if not (req_host.endswith(domain) or erhn.endswith(domain)):
1182+
if domain and not domain.startswith("."):
1183+
dotdomain = "." + domain
1184+
else:
1185+
dotdomain = domain
1186+
if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
11781187
#_debug(" request domain %s does not match cookie domain %s",
11791188
# req_host, domain)
11801189
return False
@@ -1191,11 +1200,15 @@ def domain_return_ok(self, domain, request):
11911200
def path_return_ok(self, path, request):
11921201
_debug("- checking cookie path=%s", path)
11931202
req_path = request_path(request)
1194-
if not req_path.startswith(path):
1195-
_debug(" %s does not path-match %s", req_path, path)
1196-
return False
1197-
return True
1203+
pathlen = len(path)
1204+
if req_path == path:
1205+
return True
1206+
elif (req_path.startswith(path) and
1207+
(path.endswith("/") or req_path[pathlen:pathlen+1] == "/")):
1208+
return True
11981209

1210+
_debug(" %s does not path-match %s", req_path, path)
1211+
return False
11991212

12001213
def vals_sorted_by_key(adict):
12011214
keys = sorted(adict.keys())

0 commit comments

Comments
 (0)
0