Update of /cvsroot/monetdb/sql/src/test/Dump/Tests
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21074
Modified Files:
Tag: Aug2009
reload.SQL.py
Log Message:
Avoid potential deadlock. If you have pipes into and out of a
process, don't write large amounts of data to the process without
checking its output. Using the communicate method, that happens
automatically.
U reload.SQL.py
Index: reload.SQL.py
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/Dump/Tests/reload.SQL.py,v
retrieving revision 1.5
retrieving revision 1.5.6.1
diff -u -d -r1.5 -r1.5.6.1
--- reload.SQL.py 11 Dec 2008 13:42:48 -0000 1.5
+++ reload.SQL.py 14 Oct 2009 07:44:52 -0000 1.5.6.1
@@ -12,14 +12,12 @@
cmd = str('%s -p %s' % (SQLCLIENT, MAPIPORT))
f = open(os.path.join(TSTTRGDIR, 'dumpoutput.sql'), 'r')
- clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
- clt.stdin.write(f.read())
- clt.stdin.close()
+ clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+ stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = clt.communicate(f.read())
f.close()
- sys.stdout.write(clt.stdout.read())
- clt.stdout.close()
- sys.stderr.write(clt.stderr.read())
- clt.stderr.close()
+ sys.stdout.write(out)
+ sys.stderr.write(err)
main()
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins