diff options
| author | Travis Shirk <travis@pobox.com> | 2017-09-26 19:16:47 -0600 |
|---|---|---|
| committer | Travis Shirk <travis@pobox.com> | 2017-09-26 19:16:47 -0600 |
| commit | ae77035e79a74f38437407c29a3966cfcad7d1ae (patch) | |
| tree | 2d8f40b11d7d51f2e69b20a85b8b347e7300c557 /magic.py | |
| parent | cf029d7cb3786754d35194fbbdc870e8f54711cd (diff) | |
| download | python-magic-ae77035e79a74f38437407c29a3966cfcad7d1ae.tar.gz | |
Handle incorrectly encoded files (i.e. does not match file system
encoding)
Diffstat (limited to 'magic.py')
| -rw-r--r-- | magic.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -213,7 +213,7 @@ def coerce_filename(filename): (sys.version_info[0] >= 3 and isinstance(filename, str)) if is_unicode: - return filename.encode('utf-8') + return filename.encode('utf-8', 'surrogateescape') else: return filename |
