Skip to content

Cannot infer type argument 1 of "shutil.copyfileobj" with mypy 0.780 #4201

Closed
@deveshks

Description

@deveshks

The following code used to pass mypy type check with mypy 0.770 but doesn't work for mypy 0.780

import shutil

filename1 = '/foo/bar'
filename2 = '/foo/baz'

srcfp =  open(filename1, 'rb')
destfp = open(filename2, 'wb')

shutil.copyfileobj(srcfp, destfp)

> mypy 0.770

$ mypy --version
mypy 0.770
$  mypy scratch.py
Success: no issues found in 1 source file

> mypy 0.780

$ mypy --version
mypy 0.780

$ scratch.py  
scratch.py:9: error: Cannot infer type argument 1 of "copyfileobj"

Do let me know if this not a typeshed issue, but instead is a mypy issue.

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