8000 Merge tag v3.5.8rc2 into branch 3.5-slp. · stackless-dev/stackless@8389534 · 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 8389534

Browse files
author
Anselm Kruis
committed
Merge tag v3.5.8rc2 into branch 3.5-slp.
2 parents c593c28 + ac4f751 commit 8389534

29 files changed

+6093
-6746
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ matrix:
4040
- cd Doc
4141
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
4242
# (Updating the version is fine as long as no warnings are raised by doing so.)
43-
- python -m pip install sphinx~=1.6.1 blurb
43+
- python -m pip install sphinx==1.8.2 blurb
4444
script:
4545
- make check suspicious html SPHINXOPTS="-q -W -j4"
4646
- os: linux

Doc/tools/extensions/pyspecific.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from sphinx.builders import Builder
2525
from sphinx.util.nodes import split_explicit_title
2626
from sphinx.writers.html import HTMLTranslator
27-
from sphinx.writers.text import TextWriter
27+
from sphinx.writers.text import TextWriter 8000 , TextTranslator
2828
from sphinx.writers.latex import LaTeXTranslator
2929
from sphinx.domains.python import PyModulelevel, PyClassmember
3030

@@ -286,8 +286,11 @@ def run(self):
286286
class PydocTopicsBuilder(Builder):
287287
name = 'pydoc-topics'
288288

289+
default_translator_class = TextTranslator
290+
289291
def init(self):
290292
self.topics = {}
293+
self.secnumbers = {}
291294

292295
def get_outdated_docs(self):
293296
return 'all pydoc topics'
@@ -296,8 +299,12 @@ def get_target_uri(self, docname, typ=None):
296299
return '' # no URIs
297300

298301
def write(self, *ignored):
302+
try: # sphinx>=1.6
303+
from sphinx.util import status_iterator
304+
except ImportError: # sphinx<1.6
305+
status_iterator = self.status_iterator
299306
writer = TextWriter(self)
300-
for label in self.status_iterator(pydoc_topic_labels,
307+
for label in status_iterator(pydoc_topic_labels,
301308
'building topics... ',
302309
length=len(pydoc_topic_labels)):
303310
if label not in self.env.domaindata['std']['labels']:

Include/patchlevel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#define PY_MINOR_VERSION 5
2121
#define PY_MICRO_VERSION 8
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA
23-
#define PY_RELEASE_SERIAL 1
23+
#define PY_RELEASE_SERIAL 2
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.5.8rc1"
26+
#define PY_VERSION "3.5.8rc2"
2727
/*--end constants--*/
2828

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

Lib/http/client.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -984,20 +984,15 @@ def putrequest(self, method, url, skip_host=False,
984984
else:
985985
raise CannotSendRequest(self.__state)
986986

987-
# Save the method we use, we need it later in the response phase
987+
# Save the method for use later in the response phase
988988
self._method = method
989-
if not url:
990-
url = '/'
991-
# Prevent CVE-2019-9740.
992-
match = _contains_disallowed_url_pchar_re.search(url)
993-
if match:
994-
raise InvalidURL("URL can't contain control characters. {!r} "
995-
"(found at least {!r})".format(url,
996-
match.group()))
989+
990+
url = url or '/'
991+
self._validate_path(url)
992+
997993
request = '%s %s %s' % (method, url, self._http_vsn_str)
998994

999-
# Non-ASCII characters should have been eliminated earlier
1000-
self._output(request.encode('ascii'))
995+
self._output(self._encode_request(request))
1001996

1002997
if self._http_vsn == 11:
1003998
# Issue some standard headers for better HTTP/1.1 compliance
@@ -1075,6 +1070,21 @@ def putrequest(self, method, url, skip_host=False,
10751070
# For HTTP/1.0, the server will assume "not chunked"
10761071
pass
10771072

1073+
def _encode_request(self, request):
1074+
# ASCII also helps prevent CVE-2019-9740.
1075+
return request.encode('ascii')
1076+
1077+
def _validate_path(self, url):
1078+
"""Validate a url for putrequest."""
1079+
# Prevent CVE-2019-9740.
1080+
match = _contains_disallowed_url_pchar_re.search(url)
1081+
if match:
1082+
msg = (
1083+
"URL can't contain control characters. {url!r} "
1084+
"(found at least {matched!r})"
1085+
).format(matched=match.group(), **locals())
1086+
raise InvalidURL(msg)
1087+
10781088
def putheader(self, header, *values):
10791089
"""Send a request header line to the server.
10801090

0 commit comments

Comments
 (0)
0