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.

Author Ramchandra Apte
Recipients Ramchandra Apte
Date 2011-12-05.14:07:42
SpamBayes Score 1.8215148e-07
Marked as misclassified No
Message-id <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za>
In-reply-to
Content
In IDLE, sys.stdout.write and sys.stderr can write any pickleable object such as 100 when they should only allow strings.
IDLE seems to be pickling the object.
>>> import sys
>>> sys.stdout.write(100)
100
>>> sys.stdout.write(sys)
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    sys.stdout.write(sys)
_pickle.PicklingError: Can't pickle <class 'module'>: attribute lookup builtins.module failed
The error above is more detailed in IDLE 2.7.
While in Python on the command-line:
>>> import sys
>>> sys.stdout.write(100)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be str, not int
>>> 
The error above in Python 2.7:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: expected a character buffer object
History
Date User Action Args
2011-12-05 14:07:43Ramchandra Aptesetrecipients: + Ramchandra Apte
2011-12-05 14:07:43Ramchandra Aptesetmessageid: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za>
2011-12-05 14:07:42Ramchandra Aptelinkissue13532 messages
2011-12-05 14:07:42Ramchandra Aptecreate