[issue3335] subprocess lib - opening same command fails

2008-07-10 Thread Justin Harper

New submission from Justin Harper <[EMAIL PROTECTED]>:

When I make the same shell call a second time, a weird error occurs.  
It appears that the system is caching the call and then returning the 
same object the second time, which causes a problem because the stream 
is at EOF and there is no way to seek on this sort of file object.

Code:
fout = subprocess.Popen("owplaces -silent -multi", shell=True, 
stdout=subprocess.PIPE).stdout
self.output = fout.read()

if self.output != []:
for line in self.output:
print line

fout.close()

Error:
Traceback (most recent call last):
  File "./saveSettings.py", line 30, in next_page
func()
  File "./saveSettings.py", line 62, in save_startup
fout = subprocess.Popen("owplaces -silent -multi", shell=True, 
stdout=subprocess.PIPE).stdout
  File "/opt/app/g++lib6/python-2.4/lib/python2.4/warnings.py", line 
61, in warn
warn_explicit(message, category, filename, lineno, module, registry)
  File "/opt/app/g++lib6/python-2.4/lib/python2.4/warnings.py", line 
82, in warn_explicit
for item in filters:
TypeError: an integer is required


The first time the code works time.  The second (and subsequent times) 
the cryptic error msg is displayed.

Python 2.4.5 running on a Solaris machine.

--
components: Library (Lib)
messages: 69514
nosy: gtg944q
severity: normal
status: open
title: subprocess lib - opening same command fails
versions: Python 2.4

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3335] subprocess lib - opening same command fails

2008-07-10 Thread Justin Harper

Justin Harper <[EMAIL PROTECTED]> added the comment:

Correction:  line two should actually be:
self.output = fout.readlines()

The bug still exists with this change.

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3335] subprocess lib - opening same command fails

2008-07-14 Thread Justin Harper

Justin Harper <[EMAIL PROTECTED]> added the comment:

Further research reveals that the problem appears to be with the 
gtk.Assistant class in PyGTK 2.10, not the subprocess lib.

Report can be closed.

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com