瀏覽代碼

[utils] Clarify Python versions affected by buggy struct module

Yen Chi Hsuan 9 年之前
父節點
當前提交
622d19160b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      youtube_dl/utils.py

+ 2 - 1
youtube_dl/utils.py

@@ -1756,7 +1756,8 @@ def escape_url(url):
 try:
     struct.pack('!I', 0)
 except TypeError:
-    # In Python 2.6 (and some 2.7 versions), struct requires a bytes argument
+    # In Python 2.6 and 2.7.x < 2.7.7, struct requires a bytes argument
+    # See https://bugs.python.org/issue19099
     def struct_pack(spec, *args):
         if isinstance(spec, compat_str):
             spec = spec.encode('ascii')