This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author takluyver
Recipients barry, ethan.furman, gregory.p.smith, martin.panter, r.david.murray, takluyver
Date 2015-01-31.21:57:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422741444.05.0.487376025058.issue23342@psf.upfronthosting.co.za>
In-reply-to
Content
Yep, they are pretty much equivalent to those, except:

- check_call has a 'return 0' if it succeeds
- add '.stdout' to the end of the expression for check_output

I'll work on documenting the trio in those terms.

If people want, some/all of the trio could also be implemented on top of run(). check_output() would be the most likely candidate for this, since I copied that code to create run(). I'd probably leave call and check_call as separate implementations to avoid subtle bugs, though.

Sharing inheritance between CalledProcessError and CompletedProcess: That would mean that either CompletedProcess is an exception class, even though it's not used as such, or CalledProcessError uses multiple inheritance. I think duplicating a few attributes is preferable to having to think about multiple inheritance, especially since the names aren't all the same (cmd vs args, output vs stdout).
History
Date User Action Args
2015-01-31 21:57:24takluyversetrecipients: + takluyver, barry, gregory.p.smith, r.david.murray, ethan.furman, martin.panter
2015-01-31 21:57:24takluyversetmessageid: <1422741444.05.0.487376025058.issue23342@psf.upfronthosting.co.za>
2015-01-31 21:57:24takluyverlinkissue23342 messages
2015-01-31 21:57:23takluyvercreate