Skip to content

Incorrect signature for tempfile.mkstemp #3449

@tgdane

Description

@tgdane

The dir argument to tempfile.mkstemp appears to be incorrectly typed.

Steps for reproduction

Create file:

# file: demo.py
import tempfile 
f = tempfile.mkstemp(dir="abc") 

then run:

$ mypy demo.py

which outputs:

a.py:2: error: Argument "dir" to "mkstemp" has incompatible type "str"; expected "None"
Found 1 error in 1 file (checked 1 source file)

System information

  • Windows 10
  • Conda 4.7.11
  • Python 3.7.4
  • mypy 0.740
  • mypy-extensions 0.4.3

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