On Sun, 11 Jan 2009 19:38:48 -0800, Aahz wrote:
> In article
> ,
> Qiangning Hong wrote:
>>
>>So, my question is, as sys.stdout IS a file object, why it does not use
>>its encoding attribute to convert the given unicode? An implementation
>>bug? A documenation bug?
>
> Please file a bug on bug
In article ,
Qiangning Hong wrote:
>
>So, my question is, as sys.stdout IS a file object, why it does not
>use its encoding attribute to convert the given unicode? An
>implementation bug? A documenation bug?
Please file a bug on bugs.python.org -- that's the only way this can be
tracked.
--
Aa
On Sun, 28 Dec 2008 02:37:55 -0800, Qiangning Hong wrote:
>> > So, my question is, as sys.stdout IS a file object, why it does not
>> > use its encoding attribute to convert the given unicode? An
>> > implementation bug? A documenation bug?
>>
>> hmm I always thought "sys.stdout" is a "file-like
On Dec 27, 12:31 am, Martin wrote:
> Python 2.4.4 (#2, Oct 22 2008, 19:52:44)
> [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> u = u"\u554a"
> >>> print u
> 啊
> >>> sys.stdout.write(u + "\n")
>
> Tracebac
Sorry GMAIL got me again, I sent this in private first, apologies.
hi,
2008/12/26 Qiangning Hong :
sys.stdout.write(u)
> Traceback (most recent call last):
> File "", line 1, in
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u554a' in
> position 0: ordinal not in range(128
>>> u = u'\u554a'
>>> print u
啊
>>> sys.stdout.write(u)
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u554a' in
position 0: ordinal not in range(128)
>>> type(sys.stdout)
>>> sys.stdout.encoding
'UTF-8'
Quote from file object