Commit Graph

45 Commits

Author SHA1 Message Date
Jelle Zijlstra
1bc1fc2117 add constructor arguments for TimeoutExpired (#2466)
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.
2018-09-18 14:02:38 +02:00
Ollie Ford
2e7e8cc009 Add 3.7 variant of subprocess.run (#2409)
Python 3.7 added:
  - `text` as an alias of `universal_newlines`
  - `capture_output` for `stdout=PIPE,stderr=PIPE`

cf. https://docs.python.org/3.7/library/subprocess.html
2018-08-23 11:50:23 -07:00
Yusuke Miyazaki
6192cce9d9 Avoid using string literals in type annotations (#2294) 2018-07-02 20:23:29 -07:00
Sebastian Rittau
95eff73ab2 Drop Python 3.3 support from several stubs (#2265)
* Drop Python 3.3 support from several stubs

* Revert wrong socketserver changes
2018-06-20 16:49:47 -07:00
Jelle Zijlstra
b1a0b8ad6e add subprocess.STARTUPINFO and some associated constants (#2041) 2018-04-12 12:29:42 -07:00
Nipunn Koorapati
5af337b438 Add subprocess annotation for TimeoutExpired (#1954) 2018-03-13 08:26:59 -07:00
Miguel Gaiowski
a8465da863 Add stub for subprocess.list2cmdline function (#1898) 2018-03-02 11:04:22 -08:00
Roy Williams
f4e3657c57 Allow subprocess functions to accept PathLike objects in 3.6 and above (#1713)
* Allow subprocess functions to accept PathLike objects in 3.6 and above

* Split up _PATH from _TXT in subprocess
2017-11-06 10:28:08 -08:00
Michael Lee
8afc1b7a08 Change subprocess constants to be type int (#1577)
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.
2017-08-26 17:07:25 -07:00
Antoine Reversat
6fe68fd120 [subprocess.run] Make timeout and input optional (#1426) 2017-06-21 13:28:16 -07:00
Cooper Lees
4656153478 Allow subprocess stdout + stderr be Optional (#1375)
- 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
2017-06-01 17:46:14 -07:00
Jason Fried
a2aa93ac29 subprocess.py env and cmd arguments accept None (#1291) 2017-05-22 15:06:24 -07:00
Sergey Passichenko
6207eb8cde Add args attribute to subprocess.Popen (#1267) 2017-05-14 13:41:38 -07:00
Jelle Zijlstra
1d6e3f492e Fix incorrect usage of AnyStr (#1215)
* 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
2017-04-27 08:47:59 -07:00
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