diff options
| author | Jordan Wiens <github@psifertex.com> | 2025-09-26 15:55:40 -0400 |
|---|---|---|
| committer | Jordan <github@psifertex.com> | 2025-10-01 15:19:28 -0400 |
| commit | e69f1b5525b6bb6d8cd08849537dba890c016b93 (patch) | |
| tree | ae7aa18206820c4199f5a948f43f42b0a396071c /python/compatibility.py | |
| parent | 420d622f83ad687d5848211f52e2e21693a44a13 (diff) | |
better handling for when utf8 decoding fails
Diffstat (limited to 'python/compatibility.py')
| -rw-r--r-- | python/compatibility.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/compatibility.py b/python/compatibility.py index 88abb2f8..5632c7a5 100644 --- a/python/compatibility.py +++ b/python/compatibility.py @@ -25,7 +25,10 @@ def pyNativeStr(arg): if isinstance(arg, str): return arg else: - return arg.decode('utf8') + try: + return arg.decode('utf8') + except UnicodeDecodeError: + return arg.decode('charmap') def valid_import(mod_name): |
