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 HWJ
Recipients HWJ, georg.brandl
Date 2008-05-22.15:17:09
SpamBayes Score 0.010269666
Marked as misclassified No
Message-id <1211469479.53.0.83820029984.issue2947@psf.upfronthosting.co.za>
In-reply-to
Content
Background:
I (as many others, too) have used the following code in the past

ARC='MyDumpFile'
tar_inp= os.popen('/bin/tar cjf '+ARC+' -T -','w')
....
tar_exit_code= tar_inp.close()
if  tar_exit_code != None and tar_exit_code % 256 :
  print "some error messages"

When replacing this - as suggested - by

TAR= Popen(('/bin/tar','cjf',ARC,'-T','-'),stdin=PIPE)
tar_inp= TAR.stdin
....
tar_inp.close() always returns None which was an indication
of NO ERROR when used together with popen.

So this has proabaly to be replaced by

tar_inp.close()
tar_exit_code= TAR.wait()

if  tar_exit_code != 0 :
  print "some error messages"


I suggest a warning / hint to change checking for errors
when upgrading to subprocess.Popen
History
Date User Action Args
2008-05-22 15:18:10HWJsetspambayes_score: 0.0102697 -> 0.010269666
recipients: + HWJ, georg.brandl
2008-05-22 15:18:06HWJsetspambayes_score: 0.0102697 -> 0.0102697
messageid: <1211469479.53.0.83820029984.issue2947@psf.upfronthosting.co.za>
2008-05-22 15:17:53HWJlinkissue2947 messages
2008-05-22 15:17:43HWJcreate