File tree 3 files changed +9
-8
lines changed
3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Features
38
38
Bugfixes
39
39
--------
40
40
41
+ * Use documented dateutil API for time zone list (Issue #3006)
41
42
* Handle trailing slash redirects with query strings correctly in
42
43
``nikola serve `` (Issue #3000)
43
44
* Fix w3c validation errors for itemscope entries in default themes
Original file line number Diff line number Diff line change @@ -384,15 +384,15 @@ def tzhandler(default, toconf):
384
384
385
385
if tz is None :
386
386
print (" WARNING: Time zone not found. Searching list of time zones for a match." )
387
- zonesfile = tarfile . open ( fileobj = dateutil .zoneinfo .getzoneinfofile_stream ())
388
- zonenames = [zone for zone in zonesfile . getnames () if answer .lower () in zone .lower ()]
389
- if len (zonenames ) == 1 :
390
- tz = dateutil .tz .gettz (zonenames [0 ])
391
- answer = zonenames [0 ]
387
+ all_zones = dateutil .zoneinfo .get_zonefile_instance (). zones
388
+ matching_zones = [zone for zone in all_zones if answer .lower () in zone .lower ()]
389
+ if len (matching_zones ) == 1 :
390
+ tz = dateutil .tz .gettz (matching_zones [0 ])
391
+ answer = matching_zones [0 ]
392
392
print (" Picking '{0}'." .format (answer ))
393
- elif len (zonenames ) > 1 :
393
+ elif len (matching_zones ) > 1 :
394
394
print (" The following time zones match your query:" )
395
- print (' ' + '\n ' .join (zonenames ))
395
+ print (' ' + '\n ' .join (matching_zones ))
396
396
continue
397
397
398
398
if tz is not None :
Original file line number Diff line number Diff line change 1
1
doit >= 0.30.1
2
2
Pygments >= 1.6
3
3
Pillow >= 2.4.0
4
- python-dateutil >= 2.4 .0
4
+ python-dateutil >= 2.6 .0
5
5
docutils >= 0.13
6
6
mako >= 1.0.0
7
7
Markdown >= 2.4.0
You can’t perform that action at this time.
0 commit comments