Illegal seek with os.popen

P

pruebauno

Should I open a bug report for this?

Python 2.5.1 (r251:54863, Sep 19 2007, 14:58:06) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
Python 3.1rc1 (r31rc1:73054, Jun 1 2009, 10:49:24) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Python-3.1rc1/Lib/os.py", line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek
 
A

Aahz

Should I open a bug report for this?

Python 2.5.1 (r251:54863, Sep 19 2007, 14:58:06) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.<open file 'cat', mode 'w' at 0x110111990>

Python 3.1rc1 (r31rc1:73054, Jun 1 2009, 10:49:24) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Python-3.1rc1/Lib/os.py", line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek

What happens in 2.6 and 3.0?
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Given that C++ has pointers and typecasts, it's really hard to have a
serious conversation about type safety with a C++ programmer and keep a
straight face. It's kind of like having a guy who juggles chainsaws
wearing body armor arguing with a guy who juggles rubber chickens wearing
a T-shirt about who's in more danger." --Roy Smith, c.l.py, 2004.05.23
 
P

pruebauno

  said:
Should I open a bug report for this?
Python 2.5.1 (r251:54863, Sep 19 2007, 14:58:06) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
import os
os.popen('cat','w')
<open file 'cat', mode 'w' at 0x110111990>
Python 3.1rc1 (r31rc1:73054, Jun  1 2009, 10:49:24) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
os.popen('cat','w')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Python-3.1rc1/Lib/os.py", line 641, in popen
   return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek

What happens in 2.6 and 3.0?
--
Aahz ([email protected])           <*>        http://www.pythoncraft.com/

"Given that C++ has pointers and typecasts, it's really hard to have a
serious conversation about type safety with a C++ programmer and keep a
straight face.  It's kind of like having a guy who juggles chainsaws
wearing body armor arguing with a guy who juggles rubber chickens wearing
a T-shirt about who's in more danger."  --Roy Smith, c.l.py, 2004.05.23

Python 2.6.2 (r262:71600, Jun 4 2009, 16:07:26) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
Python 3.0.1 (r301:69556, Jun 4 2009, 16:07:22) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.<os._wrap_close object at 0x1103e5748>

So it seems to be something in 3.1 that causes it to fail.
BTW it is not like I use os.popen a lot. I found this problem while
trying to use help().

Python 3.1rc1 (r31rc1:73054, Jun 1 2009, 10:49:24) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Python-3.1rc1/Lib/site.py", line 429, in __call__
return pydoc.help(*args, **kwds)
File "/Python-3.1rc1/Lib/pydoc.py", line 1709, in __call__
self.help(request)
File "/Python-3.1rc1/Lib/pydoc.py", line 1756, in help
else: doc(request, 'Help on %s:')
File "/Python-3.1rc1/Lib/pydoc.py", line 1505, in doc
pager(render_doc(thing, title, forceload))
File "/Python-3.1rc1/Lib/pydoc.py", line 1320, in pager
pager(text)
File "/Python-3.1rc1/Lib/pydoc.py", line 1340, in <lambda>
return lambda text: pipepager(text, 'less')
File "/Python-3.1rc1/Lib/pydoc.py", line 1359, in pipepager
pipe = os.popen(cmd, 'w')
File "/Python-3.1rc1/Lib/os.py", line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek
 
T

Terry Reedy

Python 3.0.1 (r301:69556, Jun 4 2009, 16:07:22) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.<os._wrap_close object at 0x1103e5748>

So it seems to be something in 3.1 that causes it to fail.
BTW it is not like I use os.popen a lot. I found this problem while
trying to use help().

Python 3.1rc1 (r31rc1:73054, Jun 1 2009, 10:49:24) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.

On Windows xp, this works fine.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Python-3.1rc1/Lib/site.py", line 429, in __call__
return pydoc.help(*args, **kwds)
File "/Python-3.1rc1/Lib/pydoc.py", line 1709, in __call__
self.help(request)
File "/Python-3.1rc1/Lib/pydoc.py", line 1756, in help
else: doc(request, 'Help on %s:')
File "/Python-3.1rc1/Lib/pydoc.py", line 1505, in doc
pager(render_doc(thing, title, forceload))
File "/Python-3.1rc1/Lib/pydoc.py", line 1320, in pager
pager(text)
File "/Python-3.1rc1/Lib/pydoc.py", line 1340, in <lambda>
return lambda text: pipepager(text, 'less')
File "/Python-3.1rc1/Lib/pydoc.py", line 1359, in pipepager
pipe = os.popen(cmd, 'w')
File "/Python-3.1rc1/Lib/os.py", line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek

Now is the time to file a bug report for this and os.popen problem;)
 
A

Aahz

[posted & e-mailed]

Python 3.0.1 (r301:69556, Jun 4 2009, 16:07:22) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.<os._wrap_close object at 0x1103e5748>

So it seems to be something in 3.1 that causes it to fail.
BTW it is not like I use os.popen a lot. I found this problem while
trying to use help().

Please file a report on bugs.python.org and send a note to python-dev.

Thanks!
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Given that C++ has pointers and typecasts, it's really hard to have a
serious conversation about type safety with a C++ programmer and keep a
straight face. It's kind of like having a guy who juggles chainsaws
wearing body armor arguing with a guy who juggles rubber chickens wearing
a T-shirt about who's in more danger." --Roy Smith, c.l.py, 2004.05.23
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top