Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
Documentation forzoneinfo.reset_tzpath states:
The to parameter must be asequence of strings oros.PathLike and not a string, all of which must be absolute paths.ValueError will be raised if something other than an absolute path is passed.
However, the error pathway for relative paths does not currently handle os.PathLike instances correctly.
>>>zoneinfo.reset_tzpath((pathlib.Path("path/to/somewhere"),))Traceback (mostrecentcalllast):File"<python-input-6>",line1,in<module>zoneinfo.reset_tzpath((pathlib.Path("path/to/somewhere"),))~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zoneinfo/_tzpath.py",line33,inreset_tzpath_reset_tzpath(to)~~~~~~~~~~~~~^^^^File"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zoneinfo/_tzpath.py",line17,in_reset_tzpathraiseValueError(_get_invalid_paths_message(tzpaths))~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^File"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zoneinfo/_tzpath.py",line63,in_get_invalid_paths_messageindented_str=prefix+prefix.join(invalid_paths)~~~~~~~~~~~^^^^^^^^^^^^^^^TypeError:sequenceitem0:expectedstrinstance,PosixPathfound
CPython versions tested on:
3.14
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done