Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13e8946

Browse files
committed
Fix a few urllib bugs (NameErrors).
Also directly import names from the various urllib submodules, saves attribute lookup and is much cleaner.
1 parent 1abcbf8 commit 13e8946

2 files changed

Lines changed: 125 additions & 126 deletions

File tree

Lib/urllib/parse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ def urlencode(query,doseq=0):
416416
# urllib.parse.unquote('abc%20def') -> 'abc def'
417417
# quote('abc def') -> 'abc%20def')
418418

419-
def toBytes(url):
420-
"""toBytes(u"URL") --> 'URL'."""
419+
def to_bytes(url):
420+
"""to_bytes(u"URL") --> 'URL'."""
421421
# Most URL schemes require ASCII. If that changes, the conversion
422422
# can be relaxed.
423-
# XXX get rid of toBytes()
423+
# XXX get rid of to_bytes()
424424
if isinstance(url, str):
425425
try:
426426
url = url.encode("ASCII").decode()

0 commit comments

Comments
 (0)