Open
Description
Bug report
According to documentation all calls to ZoneInfo should raise ValueError
or ZoneInfoNotFoundError
.
Creating a ZoneInfo object with an invalid very long timezone (length > 255) an OSError is raised instead (OSError: [Errno 36] File name too long
).
I believe that
cpython/Lib/zoneinfo/_common.py
Lines 11 to 24 in 29f1b0b
OSError
exception raised by open and reraise it to ZoneInfoNotFoundError
.
Sample code for reproduction:
from zoneinfo import ZoneInfo
ZoneInfo("a"*256)
Your environment
- CPython versions tested on: Python 3.10.4
- Operating system and architecture: Debian GNU/Linux 11 (bullseye)
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
No status