socket.bind(Path(...)) does not work
未关闭
还没有人认领这个 Issue。
stdlib
topic-socket
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
s = socket(AF_UNIX, SOCK_DGRAM)
s.bind(Path('/tmp/qwe3333'))
gives:
TypeError: a bytes-like object is required, not 'PosixPath'
According to some PEP all path-related functions should accept Path.
Linked PRs
- gh-99599
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从提供的 Python 复现程序开始,检查 socket.bind 路径的处理。开始之前先查看链接的 PR gh-99599,因为该 issue 已经指向其他地方的工作。完成标准是:socket.bind 能够为 Unix 数据报 socket 接受所示的 pathlib.Path,而不会引发 TypeError,并且有针对该行为的覆盖测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100