aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-11-18 23:28:42 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-11-19 00:02:24 +0100
commit92120217eb27d820bfba0f6a50837f111cbf80ef (patch)
treecca45f0af01267f8c88c23331b6f43884750025b /youtube_dl/utils.py
parent37eddd314319d42f509307698196e4e9a8e84c7e (diff)
[cache] Fix writing to paths with unicode characters
* Use "compat_getenv" * "write_json_file" now expects the filename to be a string
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 50e515a04..94b496dd0 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -73,6 +73,7 @@ def preferredencoding():
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):
encoding = get_filesystem_encoding()
# os.path.basename returns a bytes object, but NamedTemporaryFile