Skip to content
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

Handle non-ascii commands in Python 2 in make_subprocess_output_error() #6671

Merged

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Jul 2, 2019

This is a follow-up to PR #6655 to fix a potential Python 2 str issue if the formatted command contains non-ascii characters. We want to be sure we don't trigger an error in make_subprocess_output_error() when calling str.format() if the command str contains non-ascii characters.

The PR does this by exposing a slightly more general variant of the console_to_str() function we call str_to_display(). It can be used to convert any byte string to text for logging purposes and not just bytes coming from a subprocess stdout (which is what console_to_str() was previously added for).

@cjerdonek cjerdonek added C: encoding Related to text encoding and likely, UnicodeErrors skip news Does not need a NEWS file entry (eg: trivial changes) labels Jul 2, 2019
@cjerdonek cjerdonek force-pushed the make-subprocess-error-non-ascii-cmd branch 9 times, most recently from 3c564a6 to d858457 Compare July 4, 2019 07:16
@cjerdonek cjerdonek force-pushed the make-subprocess-error-non-ascii-cmd branch from d858457 to a6020e8 Compare July 4, 2019 07:54
@cjerdonek
Copy link
Member Author

Thanks, @xavfernandez.

@cjerdonek cjerdonek merged commit 0d5a983 into pypa:master Jul 4, 2019
@cjerdonek cjerdonek deleted the make-subprocess-error-non-ascii-cmd branch July 4, 2019 22:43
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: encoding Related to text encoding and likely, UnicodeErrors skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants