Message148873
| 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:43 | Ramchandra Apte | set | recipients:
+ Ramchandra Apte |
| 2011年12月05日 14:07:43 | Ramchandra Apte | set | messageid: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> |
| 2011年12月05日 14:07:42 | Ramchandra Apte | link | issue13532 messages |
| 2011年12月05日 14:07:42 | Ramchandra Apte | create |
|