Rev 65: Use subprocess.communicate rather than wait, avoiding deadlocks. in http://people.canonical.com/~robertc/baz2.0/plugins/builder/blocking
Robert Collins
robertc at robertcollins.net
Wed Oct 28 00:35:06 GMT 2009
At http://people.canonical.com/~robertc/baz2.0/plugins/builder/blocking
------------------------------------------------------------
revno: 65
revision-id: robertc at robertcollins.net-20091028003419-rtg5fy624twn7l0e
parent: robertc at robertcollins.net-20091023204322-xwrr30wou3jjwyi1
committer: Robert Collins <robertc at robertcollins.net>
branch nick: blocking
timestamp: Wed 2009-10-28 11:34:19 +1100
message:
Use subprocess.communicate rather than wait, avoiding deadlocks.
=== modified file '__init__.py'
--- a/__init__.py 2009-10-23 20:37:24 +0000
+++ b/__init__.py 2009-10-28 00:34:19 +0000
@@ -399,8 +399,6 @@
# Get maintainer's mail address
if 'DEBEMAIL' in env:
email = env['DEBEMAIL']
- elif 'MAIL' in env:
- email = env['MAIL']
else:
addr = None
if os.path.exists('/etc/mailname'):
@@ -458,14 +456,18 @@
trace.note("Uploading the source package")
command = ["/usr/bin/debrelease", "-S", "--dput", target]
proc = subprocess.Popen(command, cwd=basedir,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
- proc.stdin.close()
- retcode = proc.wait()
+ trace.note("1")
+ output, err = proc.communicate()
+ print output, err
+ trace.note("2")
+ retcode = proc.returncode
if retcode != 0:
- output = proc.stdout.read()
+ trace.note("3")
raise errors.BzrCommandError("Uploading the package failed: "
"%s" % output)
+ trace.note("Uploaded the source package")
register_command(cmd_dailydeb)
More information about the bazaar-commits
mailing list