Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

zoneinfo.reset_tzpath raises TypeError instead of ValueError if passed a sequence with a relative Pathlike #138432

Closed
Labels
3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@tungol

Description

@tungol

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

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp