0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-18 01:35:12 +00:00

[utils] Clarify Python versions affected by buggy struct module

This commit is contained in:
Yen Chi Hsuan 2016-03-24 18:06:15 +08:00
parent 32d88410eb
commit 622d19160b

View file

@ -1756,7 +1756,8 @@ def escape_url(url):
try: try:
struct.pack('!I', 0) struct.pack('!I', 0)
except TypeError: 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): def struct_pack(spec, *args):
if isinstance(spec, compat_str): if isinstance(spec, compat_str):
spec = spec.encode('ascii') spec = spec.encode('ascii')