Skip to content
Permalink
Browse files

Fix #2806 -- always define locale_n when guessing

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 29, 2017
1 parent 574621f commit 74abaf832d2db68de3fe34b9ddb3326f1b56ff08
Showing with 6 additions and 1 deletion.
  1. +5 −0 CHANGES.txt
  2. +1 −1 nikola/nikola.py
@@ -6,6 +6,11 @@ Features

* Support for JSON, YAML and TOML metadata (Issue #2801)

Bugfixes
--------

* Fix unbound variable error in locale guessing (Issue #2806)

New in v7.8.6
=============

@@ -2823,7 +2823,7 @@ def guess_locale_from_lang_posix(lang):
# only that type is accepted by the locale module
locale_n = str('.'.join(locale.getdefaultlocale()))
except (ValueError, TypeError):
pass
locale_n = str()
# Use guess only if it’s the same language
if not locale_n.startswith(lang.lower()):
locale_n = str()

0 comments on commit 74abaf8

Please sign in to comment.