Message89490
The documentation for the print function specifies that the input
argument is coerced to string. However, if bytes are passed and the
file= parameter points to a file open for binary write, the error
message produced is:
>>> out = open('temp', 'wb')
>>> print(b'abc', file=out)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: write() argument 1 must be bytes or buffer, not str
which is, to say the least, confusing, since I clearly passed print a
bytes object as argument 1. |
|
Date |
User |
Action |
Args |
2009-06-18 02:51:46 | r.david.murray | set | recipients:
+ r.david.murray |
2009-06-18 02:51:45 | r.david.murray | set | messageid: <1245293505.96.0.175038220478.issue6304@psf.upfronthosting.co.za> |
2009-06-18 02:51:44 | r.david.murray | link | issue6304 messages |
2009-06-18 02:51:43 | r.david.murray | create | |
|