Message69514
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. |
|
Date |
User |
Action |
Args |
2008-07-10 18:21:50 | gtg944q | set | spambayes_score: 0.00272849 -> 0.0027284902 recipients:
+ gtg944q |
2008-07-10 18:21:49 | gtg944q | set | spambayes_score: 0.00272849 -> 0.00272849 messageid: <1215714109.54.0.694073882859.issue3335@psf.upfronthosting.co.za> |
2008-07-10 18:21:48 | gtg944q | link | issue3335 messages |
2008-07-10 18:21:47 | gtg944q | create | |
|