Author AndiDog
Recipients AndiDog, docs@python
Date 2015-03-23.14:28:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za>
In-reply-to
Content
Reading over the section "Replacing os.system()" (https://docs.python.org/2/library/subprocess.html#replacing-os-system), one might assume that the return value of os.system and subprocess.call are equivalent.

    status = os.system("mycmd" + " myarg")
    # becomes
    status = subprocess.call("mycmd" + " myarg", shell=True)

However, they are not. Example:

    import sys
    import os
    import subprocess

    print subprocess.call("false")
    print os.system("false")

gives 1 and 256, respectively. Maybe this could be rephrased for clarity, or a hint added.
History
Date User Action Args
2015-03-23 14:28:11AndiDogsetrecipients: + AndiDog, docs@python
2015-03-23 14:28:11AndiDogsetmessageid: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za>
2015-03-23 14:28:11AndiDoglinkissue23750 messages
2015-03-23 14:28:11AndiDogcreate