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
349349
350350 This function only includes canonical zone names and does not include
351351 "special" zones such as those under the ``posix/ `` and ``right/ ``
352- directories, or the ``posixrules `` zone.
352+ directories, the `` posixrules `` or the ``localtime `` zone.
353353
354354 .. caution ::
355355
Original file line number Diff line number Diff line change @@ -1941,6 +1941,21 @@ def test_exclude_posixrules(self):
19411941 actual = self .module .available_timezones ()
19421942 self .assertEqual (actual , expected )
19431943
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 )
19441959
19451960class CTestModule (TestModule ):
19461961 module = c_zoneinfo
Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ def valid_key(fpath):
170170 # posixrules is a special symlink-only time zone where it exists, it
171171 # should not be included in the output
172172 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" )
173177
174178 return valid_zones
175179
You can’t perform that action at this time.
0 commit comments