Closed
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.812
presumably fileobj
should use a Protocol
of some shape ?