1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 16:57:40 +00:00

Fix UnicodeEncodeError with --write-info-json on Python 2.7 + Windows

Fixes #4244
This commit is contained in:
Ivan Kozik 2014-11-20 06:04:04 +00:00
parent 07e378fa18
commit 61ee5aeb73

View file

@ -74,7 +74,7 @@ def write_json_file(obj, fn):
""" Encode obj as JSON and write it to fn, atomically """
fn = encodeFilename(fn)
if sys.version_info < (3, 0):
if sys.version_info < (3, 0) and sys.platform != 'win32':
encoding = get_filesystem_encoding()
# os.path.basename returns a bytes object, but NamedTemporaryFile
# will fail if the filename contains non ascii characters unless we