projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
496c192
)
[xattr] Write bytestrings, not characters
author
Philipp Hagemeister
<phihag@phihag.de>
Tue, 7 Jan 2014 05:11:21 +0000
(06:11 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Tue, 7 Jan 2014 05:11:21 +0000
(06:11 +0100)
youtube_dl/postprocessor/xattrpp.py
patch
|
blob
|
history
diff --git
a/youtube_dl/postprocessor/xattrpp.py
b/youtube_dl/postprocessor/xattrpp.py
index 440df93ecc1503668f460284b8a325c8f61ee80f..5811d3568f02982b9df2e1d1645b1c28d8115d61 100644
(file)
--- a/
youtube_dl/postprocessor/xattrpp.py
+++ b/
youtube_dl/postprocessor/xattrpp.py
@@
-5,6
+5,7
@@
import sys
from .common import PostProcessor
from ..utils import (
hyphenate_date,
from .common import PostProcessor
from ..utils import (
hyphenate_date,
+ preferredencoding,
)
)
@@
-70,7
+71,7
@@
class XAttrMetadataPP(PostProcessor):
e = OSError(potential_errno, potential_errorstr)
e.__cause__ = None
raise e
e = OSError(potential_errno, potential_errorstr)
e.__cause__ = None
raise e
- raise # Reraise unhandled error
+ raise
# Reraise unhandled error
else:
# On Unix, and can't find pyxattr, setfattr, or xattr.
else:
# On Unix, and can't find pyxattr, setfattr, or xattr.
@@
-113,7
+114,8
@@
class XAttrMetadataPP(PostProcessor):
if infoname == "upload_date":
value = hyphenate_date(value)
if infoname == "upload_date":
value = hyphenate_date(value)
- write_xattr(filename, xattrname, value)
+ byte_value = value.encode(preferredencoding())
+ write_xattr(filename, xattrname, byte_value)
return True, info
return True, info