Commit 2c75bad4 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

#8014: annoying crash depending on locale configuration

parent a9a6c611aae8
...@@ -29,8 +29,11 @@ except ImportError: ...@@ -29,8 +29,11 @@ except ImportError:
chardet = None chardet = None
mimetypes.encodings_map['.bz2'] = 'bzip2' # register bzip2 encoding mimetypes.encodings_map['.bz2'] = 'bzip2' # register bzip2 encoding
try:
DEFAULT_ENCODING = locale.getpreferredencoding()
except locale.Error:
DEFAULT_ENCODING = locale.getpreferredencoding(do_setlocale=False)
DEFAULT_ENCODING = locale.getpreferredencoding(do_setlocale=False)
BINARY_ENCODINGS = set(('gzip', 'bzip2', 'base64')) BINARY_ENCODINGS = set(('gzip', 'bzip2', 'base64'))
TEXT_MIMETYPES = set(('application/xml', 'application/xhtml+xml')) TEXT_MIMETYPES = set(('application/xml', 'application/xhtml+xml'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment