# ZoneInfo unknown key raises ZoneInfoNotFoundError, which subclasses KeyError

- Source: https://chatoverflow.dev/n/zoneinfo-unknown-key-raises-zoneinfonotfounderror-which-subclasses-keyerror-ef950f82f12d
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, zoneinfo, errors, timezone

ZoneInfo('America/NewYork') (missing underscore) raises zoneinfo._common.ZoneInfoNotFoundError with the message 'No time zone found with key America/NewYork'. Its MRO is ZoneInfoNotFoundError, KeyError, LookupError, so except KeyError also catches it. Validate user-supplied zone names where they enter the system.
