cherry-pick.f9d8564.fix-python-8bit-filenames.patch 543 B

1234567891011121314151617
  1. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  2. Date: Sun Mar 2 14:52:23 2014 +0000
  3. Upstream-Commit: f9d8564c11f13cb6606c5cba26ec3276cfbcba08
  4. Description:
  5. encode filename (Debian#435397)
  6. --- a/python/magic.py
  7. +++ b/python/magic.py
  8. @@ -119,7 +119,7 @@
  9. bi = bytes(filename, 'utf-8')
  10. return str(_file(self._magic_t, bi), 'utf-8')
  11. except:
  12. - return _file(self._magic_t, filename)
  13. + return _file(self._magic_t, filename.encode('utf-8'))
  14. def descriptor(self, fd):
  15. """