Compare commits

...

4 Commits

Author SHA1 Message Date
Miss Islington (bot) 741f22df24
Allow / character in username,password fields in _PROXY envvars. (GH-23973) (#23992)
(cherry picked from commit 030a713183)

Co-authored-by: Senthil Kumaran <senthil@uthcode.com>
2020-12-29 05:15:14 -08:00
Miss Islington (bot) 70ced2dd27
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
The descriptions of the `codes` and `messages` dictionaries in
`xml.parsers.expat.errors` were swapped, and this commit swaps them
back. For example, `codes` maps string descriptions of errors to numeric
error codes, not the other way around.
(cherry picked from commit 84402eb110)

Co-authored-by: Michael Wayne Goodman <goodman.m.w@gmail.com>
2020-12-29 04:42:05 -08:00
Miss Islington (bot) 8f9313c83f
[doc] Fix missing commas in signatures (GH-23693)
* Fix star in signatures

* Fix comma in signatures
(cherry picked from commit 60eccd0956)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-29 04:28:47 -08:00
Miss Islington (bot) 323cbb5531
bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)
Tk can internally support bignum even if Tkinter is built without
support of bignum.
(cherry picked from commit 156b7f7052)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-12-29 03:16:43 -08:00
7 changed files with 21 additions and 8 deletions

View File

@ -1215,7 +1215,7 @@ Instance methods:
.. method:: datetime.replace(year=self.year, month=self.month, day=self.day, \ .. method:: datetime.replace(year=self.year, month=self.month, day=self.day, \
hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \ hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \
tzinfo=self.tzinfo, * fold=0) tzinfo=self.tzinfo, *, fold=0)
Return a datetime with the same attributes, except for those attributes given Return a datetime with the same attributes, except for those attributes given
new values by whichever keyword arguments are specified. Note that new values by whichever keyword arguments are specified. Note that
@ -1779,7 +1779,7 @@ Other constructor:
Instance methods: Instance methods:
.. method:: time.replace(hour=self.hour, minute=self.minute, second=self.second, \ .. method:: time.replace(hour=self.hour, minute=self.minute, second=self.second, \
microsecond=self.microsecond, tzinfo=self.tzinfo, * fold=0) microsecond=self.microsecond, tzinfo=self.tzinfo, *, fold=0)
Return a :class:`.time` with the same value, except for those attributes given Return a :class:`.time` with the same value, except for those attributes given
new values by whichever keyword arguments are specified. Note that new values by whichever keyword arguments are specified. Note that

View File

@ -116,7 +116,7 @@ Currently the email package provides only one concrete content manager,
decoding the payload to unicode. The default error handler is decoding the payload to unicode. The default error handler is
``replace``. ``replace``.
.. method:: set_content(msg, <'str'>, subtype="plain", charset='utf-8' \ .. method:: set_content(msg, <'str'>, subtype="plain", charset='utf-8', \
cte=None, \ cte=None, \
disposition=None, filename=None, cid=None, \ disposition=None, filename=None, cid=None, \
params=None, headers=None) params=None, headers=None)

View File

@ -665,14 +665,14 @@ The ``errors`` module has the following attributes:
.. data:: codes .. data:: codes
A dictionary mapping numeric error codes to their string descriptions. A dictionary mapping string descriptions to their error codes.
.. versionadded:: 3.2 .. versionadded:: 3.2
.. data:: messages .. data:: messages
A dictionary mapping string descriptions to their error codes. A dictionary mapping numeric error codes to their string descriptions.
.. versionadded:: 3.2 .. versionadded:: 3.2

View File

@ -446,7 +446,7 @@ class TclTest(unittest.TestCase):
else: else:
self.assertEqual(result, str(i)) self.assertEqual(result, str(i))
self.assertIsInstance(result, str) self.assertIsInstance(result, str)
if tcl_version < (8, 5): # bignum was added in Tcl 8.5 if get_tk_patchlevel() < (8, 5): # bignum was added in Tcl 8.5
self.assertRaises(TclError, tcl.call, 'expr', str(2**1000)) self.assertRaises(TclError, tcl.call, 'expr', str(2**1000))
def test_passing_values(self): def test_passing_values(self):

View File

@ -1846,9 +1846,17 @@ class MiscTests(unittest.TestCase):
('ftp', 'joe', 'password', 'proxy.example.com')), ('ftp', 'joe', 'password', 'proxy.example.com')),
# Test for no trailing '/' case # Test for no trailing '/' case
('http://joe:password@proxy.example.com', ('http://joe:password@proxy.example.com',
('http', 'joe', 'password', 'proxy.example.com')) ('http', 'joe', 'password', 'proxy.example.com')),
# Testcases with '/' character in username, password
('http://user/name:password@localhost:22',
('http', 'user/name', 'password', 'localhost:22')),
('http://username:pass/word@localhost:22',
('http', 'username', 'pass/word', 'localhost:22')),
('http://user/name:pass/word@localhost:22',
('http', 'user/name', 'pass/word', 'localhost:22')),
] ]
for tc, expected in parse_proxy_test_cases: for tc, expected in parse_proxy_test_cases:
self.assertEqual(_parse_proxy(tc), expected) self.assertEqual(_parse_proxy(tc), expected)

View File

@ -779,7 +779,11 @@ def _parse_proxy(proxy):
raise ValueError("proxy URL with no authority: %r" % proxy) raise ValueError("proxy URL with no authority: %r" % proxy)
# We have an authority, so for RFC 3986-compliant URLs (by ss 3. # We have an authority, so for RFC 3986-compliant URLs (by ss 3.
# and 3.3.), path is empty or starts with '/' # and 3.3.), path is empty or starts with '/'
end = r_scheme.find("/", 2) if '@' in r_scheme:
host_separator = r_scheme.find('@')
end = r_scheme.find("/", host_separator)
else:
end = r_scheme.find("/", 2)
if end == -1: if end == -1:
end = None end = None
authority = r_scheme[2:end] authority = r_scheme[2:end]

View File

@ -0,0 +1 @@
Allow / character in username, password fields on _PROXY envars.