fall back to ASCII if default locale is None

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3403 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-07-19 16:42:43 +00:00
parent adc4e8c0e8
commit a311497e66
2 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,11 @@
Type: bugfix
Changed: linkcheck/checker/urlbase.py
* If default encoding cannot be determined, fall back to ASCII.
Type: bugfix
Changed: linkcheck/i18n.py
Closes: SF bug #1524800
4.1 "Tsotsi" (released 29.5.2006)
* Wait for spawned threads to finish before shutdown. Gets rid

View file

@ -27,6 +27,10 @@ import gettext
supported_languages = ['en']
default_language = 'en'
default_encoding = locale.getpreferredencoding()
# It can happen that the preferrec encoding is not determinable, which
# means the function returned None. Fall back to ASCII in this case.
if default_encoding is None:
default_encoding = "ascii"
def install_builtin (translator, do_unicode):
"""