Commit Graph

31 Commits

Author SHA1 Message Date
Shengpei Zhang
c0bbfbdec5 add encoding parameter for subprocess.check_output() function in Python 3.6+ (#1095)
* add encoding parameter for check_output() function in Python 3.6+

* add errors parameter for subprocess.check_output() function
2017-03-25 14:07:25 -07:00
Guido van Rossum
fd77dd2e7a Make type of 'env' more flexible (#1091)
See https://github.com/python/typeshed/pull/1059#issuecomment-289150121
2017-03-24 15:58:01 -07:00
Josiah Boning
62f57e4cef Improve types for subprocess module (#1059)
* 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
2017-03-24 08:23:36 -07:00
Antoine Reversat
01b3915b3f Add encoding and errors keyword arguments (new in 3.6) (#1001) 2017-03-14 10:44:10 -07:00
Łukasz Langa
05cba488a5 Revert "Fix click annotation syntax and add missing keyword arguments to subprocess (new in 3.76) (#999)"
This reverts commit 43a1f761b2.
2017-03-14 08:13:14 -07:00
Antoine Reversat
43a1f761b2 Fix click annotation syntax and add missing keyword arguments to subprocess (new in 3.76) (#999)
* Fix click annotations

* Add encoding and errors keyword arguments (new in 3.6)
2017-03-14 08:02:12 -07:00
Jelle Zijlstra
a9bb7f89d3 Fixes to subprocess.CompletedProcess (#895) 2017-01-29 20:16:49 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Lukasz Langa
b84f20a011 Fixing flake8 W errors 2016-12-19 21:52:56 -08:00
Philip House
830c2fb089 updating stderr to return type Any (#776) 2016-12-16 11:51:52 +00:00
Philip House
bc252d69ac set subprocess stdout to be type Any (#581) (#761) 2016-12-13 14:23:45 +00:00
George King
dccc29bc2f Add None to type union for subprocess.Popen.communicate input. (#743)
* 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]`.
2016-12-07 14:46:34 -08:00
Guido van Rossum
8d1026cade Fix timeout parameter to Popen.wait() -- it is optional (in both senses). 2016-10-15 21:12:32 -07:00
Sebastian Meßmer
b9ab4ae1c2 Add timeout parameter to subprocess.Popen.wait() (#607)
Also define TimeoutExpired exception.
2016-10-15 14:59:40 -07:00
Sebastian Meßmer
052574d821 Add missing type hints to subprocess.pyi (#539) 2016-09-13 09:17:17 -07:00
David Fisher
f209136b3c Make appropriate Popen constructor args Optional (#457) 2016-08-08 20:14:13 -07:00
Guido van Rossum
cc1f92103d Minor cleanup of subprocess.pyi 2016-08-05 17:32:17 -07:00
jdelic
1ac3c2f173 update subprocess module stub for Python 3.5 (#426) 2016-08-05 17:31:10 -07:00
wreed4
382cb5fe20 Updating subprocess.pyi to support python 3.5 (#438)
* 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.
2016-08-05 07:01:34 -07:00
Daniël van Eeden
51a519b358 Add timeout argument to Popen communicate (#423)
This was added in Python 3.3
2016-08-03 15:39:35 -07:00
Eklavya Sharma
a7754c3eff subprocess: Fix return type of check_output.
check_output's return type can be str if universal_newlines=True.
2016-07-07 22:04:29 +05:30
Matthias Kramm
7bef3added Merge pull request #297 from alvarocaceres/subprocess
Fix signatures of call, check_call and check_output in subprocess
2016-07-06 10:54:01 -07:00
Eklavya Sharma
15714bb0e8 Set a default value for output in CalledProcessError.__init__ (#329) 2016-07-02 07:40:09 -07:00
Alvaro Caceres
5886a5dfcd Fix signatures of call, check_call and check_output in subprocess 2016-06-15 13:34:02 -05:00
Tim Abbott
ea734c69d0 Fix subprocess stubs (#198)
* 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.
2016-05-12 14:45:23 -07:00
Ben Darnell
f08160bd4c subprocess: make output argument to CalledProcessError optional 2016-04-11 00:27:58 -04:00
Guido van Rossum
54ba6d9b73 Fix typos: termina[ta]te(). 2016-03-09 09:21:15 -08:00
Matthias Kramm
94c9ce8fd0 Consistently use '= ...' for optional parameters. 2015-11-09 13:55:02 -08:00
Matthias Kramm
d2a3d4a4ed Use explicit "# type: str" instead of '' shortcut. 2015-11-09 07:59:24 -08:00
Matthias Kramm
c59a54a81a apply subprocess 'cwd' fix from Vlad-Shcherbina 2015-10-07 08:41:07 -07:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00