Previously, constructing a TimeoutExpired directly worked because Exception allowed arbitrary kwargs. We fixed that recently, but now mypy gives an error on creating a TimeoutExpired with legal arguments.
This change modifies the PIPE, STDOUT, and DEVNULL constants in the
subprocess module to be of type 'int'.
Note that the Python 2 subprocess module was already typed this way;
this commit is just updating the Python 3 subprocess module in the same
way.
- Adding optional to _FILE for stderr + stdout arguments to subprocess functions
- Sometimes you might want subprocess commands to be quiet and other time print the output
* Fix incorrect usage of AnyStr
- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr
* pstats: python 2 accepts unicode
* Improve types for CalledProcessError
This adds union types in the constructor to account for parameters that
might be either byte strings or unicode strings. At the same time, this
*removes* specific types from the user-accessible fields, to avoid the
need for users to at every use site specify which types their particular
instance was instantiated with.
* remove 'moral' comments; add List import; change 'str' to 'Text'
* import Text
* List -> Sequence; reinsert 'moral' comments
* Regularize string types everywhere
This defines _TXT and _CMD aliases, and uses them everywhere applicable.
Also brings the _FILE alias to python3.
* fix typo; possibly fix indentation
* remove trailing comma, which caused problems in python 2 tests
* fix py2 outputs to be bytes; tweak descriptive comments; remove one AnyStr
* Add `None` to type union for `subprocess.Popen.communicate` stub's `input` parameter.
* subprocess.communicate `input` annotated as `Optional[AnyStr]` for both 2.7 and 3.x; `timeout` as `Optional[float]`.
* Updating subprocess.pyi to support python 3.5
Also added DEVNULL which was added in 3.3
* Incorrectly checked sys.version_info
* Addressed travis build failures
Forgot that __init__ should return None and also forgot "self" on a method. Like a dummy.
* subprocess.CalledProcessError output argument is optional.
* subprocess.CalledProcessError takes stderr argument in python3.
* subprocess: Fix type for command in call() and friends.
The stubs didn't correctly support the fact that you can pass a string
as well as a sequence of strings.