Skip to content

Commit

Permalink
Fix #2806 -- always define locale_n when guessing
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 29, 2017
1 parent 574621f commit 74abaf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.txt
Expand Up @@ -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
=============

Expand Down
2 changes: 1 addition & 1 deletion nikola/nikola.py
Expand Up @@ -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()
Expand Down

0 comments on commit 74abaf8

Please sign in to comment.