Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Issue 582933002: Make check_output of subprocess2 compatible with Python's subprocess. (Closed)

Created:
6 years, 3 months ago by tandrii(chromium)
Modified:
6 years, 3 months ago
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, iannucci+depot_tools_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Project:
tools
Visibility:
Public.

Description

Make check_output of subprocess2 compatible with Python's subprocess. According to Python's doc ( https://docs.python.org/2/library/subprocess.html#subprocess.check_output ): if check_output raises exception CalledProcessError, the exception object should contain stdout data as `output` attribute. Before this commit, subprocess2.CalledProcessError had `output` always None, and used `stdout` instead. This commit fixes this problem storing the same data in both `stdout` and `output`. BUG=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=292036

Patch Set 1 #

Total comments: 4

Patch Set 2 : Missing period. #

Patch Set 3 : Simplified per iannucci suggestion. #

Total comments: 1

Patch Set 4 : compatibility typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M subprocess2.py View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
tandrii(chromium)
I found this incompatibility while writing this CL: https://codereview.chromium.org/578423002/ (see line 412-416). WDYT?
6 years, 3 months ago (2014-09-18 20:54:12 UTC) #2
iannucci
tbh, I'd rather there be one way to do it... if `output` is the right ...
6 years, 3 months ago (2014-09-18 20:59:04 UTC) #4
tandrii(chromium)
I think the rational for using output in Python standard is because one can combine ...
6 years, 3 months ago (2014-09-18 22:23:05 UTC) #5
M-A Ruel
FTR, I initially wrote this script when we were stuck on python 2.4~2.6. It's not ...
6 years, 3 months ago (2014-09-18 22:42:46 UTC) #7
M-A Ruel
On 2014/09/18 22:42:46, M-A Ruel wrote: > FTR, I initially wrote this script when we ...
6 years, 3 months ago (2014-09-18 22:42:55 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/582933002/60001
6 years, 3 months ago (2014-09-19 11:49:39 UTC) #10
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 292036
6 years, 3 months ago (2014-09-19 11:51:45 UTC) #11
pgervais
6 years, 3 months ago (2014-09-22 04:28:48 UTC) #12
Message was sent while issue was closed.
On 2014/09/19 11:51:45, I haz the power (commit-bot) wrote:
> Committed patchset #4 (id:60001) as 292036

Note that this modification is not compatible with Python 2.6.

Powered by Google App Engine
This is Rietveld 408576698