Skip to content

Commit

Permalink
Merge pull request #3511 from getnikola/fix-3510-time-zone-guessing
Browse files Browse the repository at this point in the history
Fix #3510 — fix time zone guessing in init (handle gettz returning None)
  • Loading branch information
Kwpolska committed Feb 13, 2021
2 parents 9b7d12f + 1e60442 commit da312e2
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 @@ -31,6 +31,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 da312e2

Please sign in to comment.