pylance flags an error for : Object of type "BufferedWriter" cannot be used with "with" because it does not implement __enter__
Opened this issue · 1 comments
Josverl commented
with open(_toml, "wb") as output:
tomli_w.dump(pyproject, output)
raises the errors
Object of type "BufferedWriter" cannot be used with "with" because it does not implement enter
class BufferedWriter:
def flush(self, *args, **kwargs) -> Any: ...
def write(self, *args, **kwargs) -> Any: ...
def __init__(self, *argv, **kwargs) -> None: ...
Josverl commented
Set BinaryIO as the baseclass for BufferedWriter will need to be done using a codemod as the class is not documented in the docstubs
already tried lookup:
"BufferedWriter": "IOBase", # DOCME: not in documentation