[pypy-issue] [issue1483] io.IOBase is missing some stub implementations

Philip Jenvey tracker at bugs.pypy.org
Fri May 10 04:16:59 CEST 2013


Philip Jenvey <pjenvey at underboss.org> added the comment:

I actually can't reproduce the AttributeError's you described on IRC:

Python 3.2.3 (9d49e7e670ec+, May 09 2013, 20:56:06)
[PyPy 2.0.0-beta2 with GCC 4.2.1 Compatible Clang Compiler] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``Seeing as the laws of physics are
against you, you have to carefully consider your scope so that your goals are
reasonable.''
>>>> import _io; file = _io._IOBase()
>>>> file.seek()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: seek
>>>> file.truncate()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: truncate
>>>> file.fileno()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: fileno

IOBase already has implementations of these methods that call 
self._unsupportedoperation. The only thing I noticed is the default seek didn't 
accept any args:

>>>> file.seek(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: seek() takes exactly 1 argument (2 given)
>>>> file.seek(0, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: seek() takes exactly 1 argument (3 given)

So I committed a subset of your tests w/ a fix for that in 55096ba173ab

Let me know if I've missed something

----------
status: unread -> resolved

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1483>
________________________________________


More information about the pypy-issue mailing list