You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
zoneinfo.reset_tzpath raises TypeError instead of ValueError if passed a sequence with a relative Pathlike #138432
The to parameter must be a sequence of strings or os.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.
I would like to try to fix this issue, this would be my first contribution to CPython.
I've read the bug report and the traceback, and it seems the problem is a TypeError being raised instead of a ValueError because the path objects are not being converted to strings before being joined for the error message.
Would it be okay for me to work on a fix? I will be sure to follow the dev guide.
Activity
JuanHPassos commentedon Sep 9, 2025
Hello,
I would like to try to fix this issue, this would be my first contribution to CPython.
I've read the bug report and the traceback, and it seems the problem is a
TypeErrorbeing raised instead of aValueErrorbecause the path objects are not being converted to strings before being joined for the error message.Would it be okay for me to work on a fix? I will be sure to follow the dev guide.
Thank you!
tungol commentedon Sep 9, 2025
Hi @JuanHPassos
You don't really need anyone's permission to work on an issue, but in this case I already have a PR up that would resolve the issue: #138433
gh-138432: Improved invalid path checking in zoneinfo.reset_tzpath() (G…
pythongh-138432: Improved invalid path checking in zoneinfo.reset_tzp…
[3.13] pythongh-138432: Improved invalid path checking in zoneinfo.re…
[3.13] gh-138432: Improved invalid path checking in zoneinfo.reset_tz…
[3.14] gh-138432: Improved invalid path checking in zoneinfo.reset_tz…