Avoid crashing on importing localtime when TZ is malformed by akx · Pull Request #1100 · python-babel/babel

@akx mentioned this pull request

Jul 17, 2024

@akx akx marked this pull request as ready for review

July 17, 2024 15:28

@akx

…rmed

When `pytz` is _not_ installed, importing `babel.localtime` could fail
(repeatedly) when the `TZ` environment variable is malformed enough to be
caught by `_validate_tzfile_path`, which might throw a certain `ValueError`.

(When `pytz` is installed, it would raise an `UnknownTimeZoneError` we
already catch and ignore for the same sort of input.)

Fixes #1092

matthiashuschle

@akx akx deleted the issue-1092 branch

July 23, 2024 07:10