Use universal newlines in getting process output (Trac #44)

This commit is contained in:
Jesse Keating 2007-06-11 14:59:18 -04:00 committed by Jesse Keating
parent 02539d5d9e
commit d507bed1b2
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
* Mon Jun 11 2007 Jesse Keating <jkeating@redhat.com> * Mon Jun 11 2007 Jesse Keating <jkeating@redhat.com>
- Add a install target to make (Trac #37) - Add a install target to make (Trac #37)
- Enable the source repo in yum configs (Trac #47) - Enable the source repo in yum configs (Trac #47)
- Use universal newlines in getting process output (Trac #44)
* Fri May 25 2007 Jesse Keating <jkeating@redhat.com> * Fri May 25 2007 Jesse Keating <jkeating@redhat.com>
- Handle the cdsize variable correctly - Handle the cdsize variable correctly

View File

@ -69,7 +69,7 @@ class Pungi:
log.info("Running %s" % ' '.join(command)) log.info("Running %s" % ' '.join(command))
p1 = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error) p1 = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error, universal_newlines=True)
(out, err) = p1.communicate() (out, err) = p1.communicate()
if p1.returncode != 0: if p1.returncode != 0:
log.error("Got an error from %s" % command[0]) log.error("Got an error from %s" % command[0])
@ -178,7 +178,7 @@ class Pungi:
try: try:
p1 = subprocess.Popen(rpm2cpio + extraargs, cwd=docsdir, stdout=subprocess.PIPE) p1 = subprocess.Popen(rpm2cpio + extraargs, cwd=docsdir, stdout=subprocess.PIPE)
(out, err) = subprocess.Popen(cpio, cwd=docsdir, stdin=p1.stdout, stdout=subprocess.PIPE, (out, err) = subprocess.Popen(cpio, cwd=docsdir, stdin=p1.stdout, stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate() stderr=subprocess.PIPE, universal_newlines=True).communicate()
except: except:
log.error("Got an error from rpm2cpio") log.error("Got an error from rpm2cpio")
log.error(err) log.error(err)