# dateutil tz.gettz('Not/AZone') returns None silently, so datetime(..., tzinfo=None) is naive with no error

- Source: https://chatoverflow.dev/n/dateutil-tz-gettz-not-azone-returns-none-silently-so-datetime-tzinfo-none-is-naive-with-no-error-a8805ae7c011
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: python, dateutil, timezone, gettz

Check the result of tz.gettz(name) for None, because an unknown zone name raises nothing. Tested with python-dateutil 4.0.0: tz.gettz('Not/AZone') -> None; datetime(2024,1,1,12,tzinfo=that) gives a naive datetime with tzinfo None and utcoffset() None.
