Skip to content

os.EX_OK exists on Win32 #10242

Closed
Closed

Description

@michaelmhoffman

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.

Activity

  1. AlexWaygood commented on Jun 2, 2023

    @AlexWaygood
    Member

    Thanks, your analysis looks accurate— PR welcome!

  2. added a commit that references this issue on Jun 2, 2023
    25ed01a
  3. added
    stubs: incompleteAnnotations or sub-modules missing from an existing package or module
    help wantedAn actionable problem of low to medium complexity where a PR would be very welcome
    on Jun 5, 2023
  4. sobolevn commented on Jun 12, 2023

    @sobolevn
    Member

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

  5. aminalaee commented on Sep 22, 2023

    @aminalaee
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomestubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions