diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2017-02-10 21:05:09 +0000 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2017-02-11 14:51:28 +0000 |
commit | 2f49bcd69076626db1b789192dd113458b1eb01c (patch) | |
tree | b4f1ce46b1069b2617aa30b72ec6b2102c374d43 /youtube_dl/utils.py | |
parent | 9b92a5917ba32644511d13a8af546d6f41282ffc (diff) |
utils.py: Workaround TypeError with Python 2.7.13 in Windows
Fixes #11540
Tested with Windows Python 2.7.12 and 2.7.13.
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index a81fe7d30..1279a9042 100644 --- 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 |