Skip to content

Fix signatures of call, check_call and check_output in subprocess #297

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

Merged
merged 1 commit into from
Jul 6, 2016
Merged

Fix signatures of call, check_call and check_output in subprocess #297

merged 1 commit into from
Jul 6, 2016

Conversation

alvarocaceres
Copy link
Contributor

No description provided.

def call(args: Union[str, Sequence[str]], *, stdin: Any = ..., stdout: Any = ...,
stderr: Any = ..., shell: bool = ...,
# Same args as Popen.__init__
def call(args: Union[str, Sequence[str]],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new definition drops the fact that all arguments except for args are keyword-only.
(That's the right thing to do for 2.7/, but I'm guessing that for 3/ the '*' was actually justified)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, didn't know about the new keyword-only-args feature -- but looks like the Popen in python3 isn't using it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptal ?

@matthiaskramm matthiaskramm merged commit 7bef3ad into python:master Jul 6, 2016
creationflags: int = ...,
restore_signals: bool = ...,
start_new_session: bool = ...,
pass_fds: Any = ...) -> bytes: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be bytes because check_output returns str when universal_newlines=True.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, my bad, sorry -- will check for similar errors and send fix, unless you already have one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's it - #348.

@alvarocaceres alvarocaceres deleted the subprocess branch July 8, 2016 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants