python / python/cpython

Permit import of .pyw under Linux

未关闭
#98,326 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

topic-importlib type-feature
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

Feature or enhancement

To allow under Linux the execution of a script written under Windows, importing modules, some of which have the .pyw file extension, it would be useful to allow linux to import the .pyw files.

Pitch

Sometimes you want to run under linux a script written under windows which import modules, some having the file extension ".pyw". Today, we are forced to rename all pyw files to py to switch from Windows to Linux. But this is not always desirable, if you use a third party script or if you work cooperatively on a project, with developers under Windows and Linux. Moreover, there is no solution to recognize the py files to be renamed to pyw when you want to switch back to Windows.

Previous discussion

Importing .pyw files has been discussed here :
https://mail.python.org/pipermail/patches/2001-August/005411.html
And it is mentioned that "with slight modification, it could
permit the extension on any platform if desired"

Another discussion on the subject :
https://stackoverflow.com/questions/21386094/importing-pyw-files-as-modules-under-linux

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定任何实现文件、测试或入口点。首先审查 Python 在 Linux 下对 .pyw 文件的导入行为以及链接的两项讨论;定义跨平台行为,并添加测试来证明无需重命名文件即可成功导入。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
operating-systems
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。