Skip to content

TextIOWrapper.encoding missing Optional Argument #3124

Closed
@WillAyd

Description

@WillAyd

Happy to submit a PR to fix but I think this is wrong

from io import BytesIO, TextIOWrapper
from typing import Optional

encoding = None  # type: Optional[str]
buf = BytesIO()
TextIOWrapper(buf, encoding=encoding)
mypy_test.py:6: error: Argument "encoding" to "TextIOWrapper" has incompatible type "Optional[str]"; expected "str"

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