File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ Functions
349
349
350
350
This function only includes canonical zone names and does not include
351
351
"special" zones such as those under the ``posix/ `` and ``right/ ``
352
- directories, or the ``posixrules `` zone.
352
+ directories, the `` posixrules `` or the ``localtime `` zone.
353
353
354
354
.. caution ::
355
355
Original file line number Diff line number Diff line change @@ -1941,6 +1941,21 @@ def test_exclude_posixrules(self):
1941
1941
actual = self .module .available_timezones ()
1942
1942
self .assertEqual (actual , expected )
1943
1943
1944
+ def test_exclude_localtime (self ):
1945
+ expected = {
1946
+ "America/New_York" ,
1947
+ "Europe/London" ,
1948
+ }
1949
+
1950
+ tree = list (expected ) + ["localtime" ]
1951
+
1952
+ with tempfile .TemporaryDirectory () as td :
1953
+ for key in tree :
1954
+ self .touch_zone (key , td )
1955
+
1956
+ with self .tzpath_context ([td ]):
1957
+ actual = self .module .available_timezones ()
1958
+ self .assertEqual (actual , expected )
1944
1959
1945
1960
class CTestModule (TestModule ):
1946
1961
module = c_zoneinfo
Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ def valid_key(fpath):
170
170
# posixrules is a special symlink-only time zone where it exists, it
171
171
# should not be included in the output
172
172
valid_zones .remove ("posixrules" )
173
+ if "localtime" in valid_zones :
174
+ # localtime is a special symlink-only time zone where it exists, it
175
+ # should not be included in the output
176
+ valid_zones .remove ("localtime" )
173
177
174
178
return valid_zones
175
179
You can’t perform that action at this time.
0 commit comments