projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54fb199
)
[utils] Use bytes-like objects as header values on Python 2
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 29 May 2016 11:25:25 +0000
(19:25 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Thu, 2 Jun 2016 07:00:49 +0000
(15:00 +0800)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 6ab1747b3cc058f1e3e22a3b5c5b8967488d5090..26f21602c0a1162bdcef711d87c87fd35481fb3d 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-866,6
+866,8
@@
class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
location_escaped = escape_url(location)
if location != location_escaped:
del resp.headers['Location']
+ if sys.version_info < (3, 0):
+ location_escaped = location_escaped.encode('utf-8')
resp.headers['Location'] = location_escaped
return resp