Skip to content

Commit

Permalink
Fix getnikola#3510 — fix time zone guessing in init (handle gettz ret…
Browse files Browse the repository at this point in the history
…urning None)
  • Loading branch information
Kwpolska committed Feb 7, 2021
1 parent 3ea078a commit 1e60442
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ New in v8.1.2
Features
--------

* Fix time zone guessing logic in ``nikola init`` (Issue #3510)
* Support for multiple authors per post — comma-separated, enabled by
``MULTIPLE_AUTHORS_PER_POST`` setting (Issue #3252)
* Add ``navbar_custom_bg`` theme option to ``bootstrap4`` and document
Expand Down
5 changes: 3 additions & 2 deletions nikola/packages/tzlocal/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ def _get_localzone(_root="/"):
while start != 0:
tzpath = tzpath[start:]
try:
dateutil.tz.gettz(tzpath)
return tzpath
tested_tz = dateutil.tz.gettz(tzpath)
if tested_tz:
return tzpath
except Exception:
pass
start = tzpath.find("/") + 1
Expand Down

0 comments on commit 1e60442

Please sign in to comment.