time: an invalid timezone that names a tzdata directory returns an error with the host's filesystem path
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从src/time/src/mcp_server_time/server.py中的get_zoneinfo开始,然后检查get_current_time和convert_time的协议测试。使用America重现目录情况,并确认两个工具都返回不含文件系统路径的Invalid timezone错误;检查未知时区错误是否仍然简洁。
由索引模型根据 Issue 内容生成。
描述
Problem
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_timeandconvert_timecalled with a tz-database directory name (America) return a cleanInvalid timezoneerror containing no filesystem path.- Existing error messages for unknown names are unchanged or equally clean.
- Tests cover the directory case at the protocol level.
- 主要语言
- TypeScript
- 星标
- 92k
- 派生
- 12k
- 平均合并
- 3 小时 12 分钟
- 30 天内合并 PR
- 174
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
enhancement server-filesystem v2
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/servers#5553 · 2 条评论 ·
维护者通常 1 天内回复
-
enhancement server-git v2
难度 1/5 1 小时以内 新手友好度 88/100
modelcontextprotocol/servers#5552 · 2 条评论 ·
维护者通常 1 天内回复
-
chore dependencies server-fetch v2
难度 2/5 1-3 小时 新手友好度 65/100
modelcontextprotocol/servers#5546 · 2 条评论 ·
维护者通常 1 天内回复
-
chore dependencies v2
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/servers#5545 · 1 条评论 ·
维护者通常 1 天内回复
-
chore server-everything v2
难度 2/5 1-3 小时 新手友好度 86/100
modelcontextprotocol/servers#5542 · 1 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 95/100
marimo-team/marimo#11949 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
Monsieur-Nico/textConvert#479 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
router-for-me/Home-Management-Center#232 ·
维护者通常 1 天内回复
-
clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster maturity:stable P3
难度 2/5 1-3 小时 新手友好度 72/100
openclaw/openclaw#200937 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug follow-up
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复