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

Skip to content

Commit 450b3c9

Browse files
committed
Potential patch for an Issue #1093
1 parent 30b9f3d commit 450b3c9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

lib/request/connect.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,6 @@ def getPage(**kwargs):
263263
# support those by default
264264
url = asciifyUrl(url)
265265

266-
# fix for known issues when using url in unicode format
267-
# (e.g. UnicodeDecodeError: "url = url + '?' + query" in redirect case)
268-
url = unicodeencode(url)
269-
270266
try:
271267
socket.setdefaulttimeout(timeout)
272268

@@ -353,6 +349,7 @@ def getPage(**kwargs):
353349
del headers[key]
354350
headers[unicodeencode(key, kb.pageEncoding)] = unicodeencode(item, kb.pageEncoding)
355351

352+
url = unicodeencode(url)
356353
post = unicodeencode(post, kb.pageEncoding)
357354

358355
if method and method not in (HTTPMETHOD.GET, HTTPMETHOD.POST):

0 commit comments

Comments
 (0)