Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.EX_OK exists on Win32 #10242

Closed
michaelmhoffman opened this issue Jun 2, 2023 · 3 comments · Fixed by #10748
Closed

os.EX_OK exists on Win32 #10242

michaelmhoffman opened this issue Jun 2, 2023 · 3 comments · Fixed by #10748
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@michaelmhoffman
Copy link

Running python.exe -m mypy . on a directory where there's a script with from os import EX_OK leads to an error on Windows:

pdfcomments\__main__.py:20: error: Module "os" has no attribute "EX_OK"; maybe "X_OK"?  [attr-defined]

stdlib/os/__init__.pyi contains a type hint for EX_OK that is guarded by an if sys.platform != "win32" block. However, since python/cpython@19459f8, EX_OK has been supported on Windows. It should be placed outside the guard block.

@AlexWaygood
Copy link
Member

Thanks, your analysis looks accurate— PR welcome!

michaelmhoffman added a commit to michaelmhoffman/typeshed that referenced this issue Jun 2, 2023
os.EX_OK has been available on Windows since at least Python 3.11. Fixes python#10242.
@AlexWaygood AlexWaygood added stubs: incomplete Annotations or sub-modules missing from an existing package or module help wanted An actionable problem of low to medium complexity where a PR would be very welcome labels Jun 5, 2023
@sobolevn
Copy link
Member

@michaelmhoffman I see your commit, but I cannot find a PR link :)
Looks like you didn't hit "Create PR" button.

@aminalaee
Copy link
Contributor

With credits to @michaelmhoffman , created a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome stubs: incomplete Annotations or sub-modules missing from an existing package or module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants