projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b92a59
)
utils.py: Workaround TypeError with Python 2.7.13 in Windows
author
Ricardo Constantino
<wiiaboo@gmail.com>
Fri, 10 Feb 2017 21:05:09 +0000
(21:05 +0000)
committer
Ricardo Constantino
<wiiaboo@gmail.com>
Sat, 11 Feb 2017 14:51:28 +0000
(14:51 +0000)
Fixes #11540
Tested with Windows Python 2.7.12 and 2.7.13.
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index a81fe7d30c4b26e9a4ec1861dd6e9c2a3f1f590d..1279a9042f343eee1dbd8eaf713e3eed06d60d3e 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1684,6
+1684,11
@@
def setproctitle(title):
libc = ctypes.cdll.LoadLibrary('libc.so.6')
except OSError:
return
+ except TypeError:
+ # LoadLibrary in Windows Python 2.7.13 only expects
+ # a bytestring, but since unicode_literals turns
+ # every string into a unicode string, it fails.
+ return
title_bytes = title.encode('utf-8')
buf = ctypes.create_string_buffer(len(title_bytes))
buf.value = title_bytes