mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-14 09:36:21 +01:00
Merge pull request #528 from lethliel/python3_fix_bsc1129889
[python3] add exception if encoding fails and try ISO-8859-1
This commit is contained in:
commit
393290bfe5
@ -61,5 +61,9 @@ def decode_it(obj):
|
||||
import chardet
|
||||
return obj.decode(chardet.detect(obj)['encoding'])
|
||||
except:
|
||||
import locale
|
||||
return obj.decode(locale.getlocale()[1])
|
||||
try:
|
||||
import locale
|
||||
return obj.decode(locale.getlocale()[1])
|
||||
except:
|
||||
return obj.decode('latin-1')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user