Skip to content

add encoding attribute to Py2 sys.stdout #3084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions stdlib/2/sys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

from typing import (
IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional,
Callable, overload, Text, Type,
Protocol, Callable, overload, Text, Type,
)
from types import FrameType, ModuleType, TracebackType, ClassType
import abc

# The following type alias are stub-only and do not exist during runtime
_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType]
Expand Down Expand Up @@ -48,6 +49,11 @@ class _version_info(Tuple[int, int, int, str, int]):
releaselevel: str
serial = 0

class _encoding(Protocol):
encoding: str

class _stdout(_encoding, IO[str], metaclass=abc.ABCMeta): ...

_mercurial: Tuple[str, str, str]
api_version: int
argv: List[str]
Expand All @@ -74,7 +80,8 @@ __stdin__: IO[str]
__stdout__: IO[str]
stderr: IO[str]
stdin: IO[str]
stdout: IO[str]
stdout: _stdout

subversion: Tuple[str, str, str]
version: str
warnoptions: object
Expand Down