summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-16 14:44:17 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-16 14:44:17 +0100
commite64eaaa97dd00b15ff0ebde17d6d6e99e6a7394e (patch)
tree924a6bb2bbcfcf7cb937b2f70e5954382174e9bf
parent780603027f8e57b0e4ec9ea1bf74b6a1afa24cb4 (diff)
downloadyoutube-dl-e64eaaa97dd00b15ff0ebde17d6d6e99e6a7394e.tar.gz
youtube-dl-e64eaaa97dd00b15ff0ebde17d6d6e99e6a7394e.tar.xz
youtube-dl-e64eaaa97dd00b15ff0ebde17d6d6e99e6a7394e.zip
Fix execution under Python 3
-rw-r--r--youtube_dl/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index f3ad47422..dbfac0f43 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1066,13 +1066,14 @@ def fix_xml_all_ampersand(xml_str):
 
 
 def setproctitle(title):
+    assert isinstance(title, type(u''))
     try:
         libc = ctypes.cdll.LoadLibrary("libc.so.6")
     except OSError:
         return
     title = title
     buf = ctypes.create_string_buffer(len(title) + 1)
-    buf.value = title
+    buf.value = title.encode('utf-8')
     try:
         libc.prctl(15, ctypes.byref(buf), 0, 0, 0)
     except AttributeError: