This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Odd exception messages when using cStringIO.StringIO instances as callables.
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, workshed
Priority: normal Keywords:

Created on 2010-03-31 05:54 by workshed, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg101978 - (view) Author: (workshed) Date: 2010-03-31 05:54
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@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
msg101979 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2010-03-31 06:03
cStringIO.StringIO is a factory function, so those messages are correct. This is mentioned in http://docs.python.org/library/stringio.html#module-cStringIO .
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52519
2010-03-31 06:03:11eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg101979

resolution: rejected
2010-03-31 05:54:30workshedcreate