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
time: an invalid timezone that names a tzdata directory returns an error with the host's filesystem path #5559
get_zoneinfo (src/time/src/mcp_server_time/server.py) turns any exception from loading a zone into ToolError(f"Invalid timezone: {e!s}"). For most bad names that is a clean "No time zone found" message, but a name that is a directory in the tz database (for example America) raises an OSError whose text includes the host's absolute path to the tzdata install, e.g.:
Invalid timezone: [Errno 21] Is a directory: '/Users/<user>/.../site-packages/tzdata/zoneinfo/America'
That leaks host filesystem details (including a home-directory user name) into tool output, and it is inconsistent with startup, where serve() already hides these messages.
Expected behavior
An invalid timezone always produces a fixed, clean message naming the input, such as Invalid timezone: America, with no exception text, whatever exception the zone loader raised.
Acceptance criteria
get_current_time and convert_time called with a tz-database directory name (America) return a clean Invalid timezone error containing no filesystem path.
Existing error messages for unknown names are unchanged or equally clean.
Tests cover the directory case at the protocol level.
Activity