[issue8272] Odd exception messages when using cStringIO.StringIO instances as callables.

workshed report at bugs.python.org
Wed Mar 31 07:54:32 CEST 2010


New submission from workshed <workshed55 at gmail.com>:

Just a minor nit (or I'm missing something), but the results of trying to use a cStringIO.StringIO instance as a callable look wrong to me.  It should of course raise an exception, but shouldn't the 'cStringIO.StringO' and 'cStringIO.StringI' strings reported in the errors below both read 'cStringIO.StringIO'?


winston at eee:~/Python-2.6.5$ ./python
Python 2.6.5 (r265:79063, Mar 30 2010, 22:38:30)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cStringIO
>>> cStringIO.StringIO()()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'cStringIO.StringO' object is not callable
>>> cStringIO.StringIO('')()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'cStringIO.StringI' object is not callable

I get the same results on my Ubuntu 9.10 system with a new build of 2.6.5 and the built in 2.6.4, as well as the 2.5.4 and 2.4.6 versions available in the repos.

Workshed

----------
components: Library (Lib)
messages: 101978
nosy: workshed
severity: normal
status: open
title: Odd exception messages when using cStringIO.StringIO instances as callables.
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8272>
_______________________________________


More information about the Python-bugs-list mailing list