diff options
| author | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 06:11:21 +0100 | 
|---|---|---|
| committer | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 06:11:21 +0100 | 
| commit | 42cc71e80b9867574234eaa155171545192c0d10 (patch) | |
| tree | 2aa64e468143824d075eb307b93a488bd1b10413 | |
| parent | 496c19234c3c1b50c6ad0c6a8aa0cbe09d54cea5 (diff) | |
[xattr] Write bytestrings, not characters
| -rw-r--r-- | youtube_dl/postprocessor/xattrpp.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/youtube_dl/postprocessor/xattrpp.py b/youtube_dl/postprocessor/xattrpp.py index 440df93ec..5811d3568 100644 --- 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, +    preferredencoding,  ) @@ -70,7 +71,7 @@ class XAttrMetadataPP(PostProcessor):                                      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. @@ -113,7 +114,8 @@ class XAttrMetadataPP(PostProcessor):                      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 | 
