Skip to content

os.open() can take Path objects in Python 3.6 #1030

Closed
@toolness

Description

@toolness

I noticed that the following code fails when checked by mypy under Python 3.6:

import os
from pathlib import Path

fd = os.open(Path('/dev/null'), os.O_RDONLY)

The following error is produced:

error: Type argument 1 of "open" has incompatible value "Path"

However, the code seems to work fine due to Python 3.6's support for PEP 519.

If this is a problem with the type stubs then I could try submitting a PR. mypy rocks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions