Message139374
Trying 3.2 code with 2.7, I got this (greatly simplified):
from __future__ import print_function
from io import StringIO
print('hello world', file=StringIO())
Traceback...
TypeError: string argument expected, got 'str'
(StringIO.StringIO works fine, of course.)
This was initially confusing. Suggestion: after
"Note Since this module has been designed primarily for Python 3.x, you have to be aware that all uses of “bytes” in this document refer to the str type (of which bytes is an alias), and all uses of “text” refer to the unicode type. "
add
'String' in exception messages may also mean the unicode type." |
|
Date |
User |
Action |
Args |
2011-06-28 19:22:58 | terry.reedy | set | recipients:
+ terry.reedy, docs@python |
2011-06-28 19:22:58 | terry.reedy | set | messageid: <1309288978.39.0.732754105333.issue12434@psf.upfronthosting.co.za> |
2011-06-28 19:22:57 | terry.reedy | link | issue12434 messages |
2011-06-28 19:22:57 | terry.reedy | create | |
|