-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
topic: ioI/O related issuesI/O related issues
Description
minimal reproduction:
import gzip
import tarfile
open('t', 'w').close()
with gzip.GzipFile('out.tar.gz', 'wb') as gzipf:
with tarfile.open(fileobj=gzipf, mode='w') as tf:
tf.add('t')$ python3 t.py
$ mypy t.py
t.py:7: error: Argument "fileobj" to "open" has incompatible type "GzipFile"; expected "Optional[IO[bytes]]"
Found 1 error in 1 file (checked 1 source file)
$ mypy --version
mypy 0.812presumably fileobj should use a Protocol of some shape ?
Metadata
Metadata
Assignees
Labels
topic: ioI/O related issuesI/O related issues