New submission from David Beazley <d...@dabeaz.com>:

Is io.FileIO.write() supposed to accept and implicitly encode Unicode strings 
as illustrated by this simple example?

>>> f = open("/dev/null","wb",buffering=0)
>>> f.write("Hello World\n")
12
>>> 

Moreover, is the behavior of BufferedWriter objects supposed to be different as 
illustrated by this example:

>>> f = open("/dev/null","wb")
>>> f.write("Hello World\n")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: write() argument 1 must be bytes or buffer, not str
>>>

----------
components: IO
messages: 98333
nosy: dabeaz
severity: normal
status: open
title: FileIO.write() accepts Unicode strings
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7785>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to