This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: print unicode string error in win8 cmd console
Type: behavior Stage: resolved
Components: IO Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, giampaolo.rodola, loewis, nkxyz, tim.golden, vstinner
Priority: normal Keywords:

Created on 2012-03-02 03:43 by nkxyz, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (7)
msg154724 - (view) Author: nkxyz (nkxyz) Date: 2012-03-02 03:43
print u'测试中文'

睺raceback (most recent call last):
  File "C:\Users\__test.py", line 96, in <module>
    sys.exit(main())
  File "C:\Users\__test.py", line 84, in main
    print u'娴嬭瘯涓枃'
IOError: [Errno 28] No space left on device

the unicode must start with a ascii char, then print can works
like this: "print u' 测试中文'"
msg154740 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-02 06:26
What is the code page of your console (try: "chcp").
msg154770 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-03-02 15:33
It looks like a duplicate of the issue #11395 which has been fixed in
Python 3.2.1, but not backported to Python 2.7. Can you please try
your program with Python 3.2.1? And maybe also attach the whole test
script?
msg154958 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-05 16:19
Victor: why do you think this is a duplicate of #11395? That issue deals with long output strings, which doesn't seem to be the case here.
msg154962 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-03-05 16:40
> Victor: why do you think this is a duplicate of #11395? That issue deals with long output strings, which doesn't seem to be the case here.

IOError('[Errno 28] No space left on device') was exactly the #11395
error message. Without the full test script, i cannot be sure that
it's a duplicate. "C:\Users\__test.py, line 96": it looks like the
program has ~100 lines and so may write something else to the console.
There are buffers in TextIOWrapper, BufferedWriter and the Windows
console itself. By the way, Python maps the Windows error
ERROR_DISK_FULL (112) to ENOSPC (28).

It's maybe something completly different.
msg154975 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-05 21:13
> IOError('[Errno 28] No space left on device') was exactly the #11395
> error message. 

I read that report differently:

IOError: [Errno 12] Not enough space

ENOMEM != ENOSPC
msg404832 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2021-10-22 21:57
Closing this as out-of-date. The original bug was reported against 2.7 and Win8, both of which are either end-of-life now.

No follow up in 9 years and I'm quite certain that modern Pythons handle all manner of Unicode chars on the console.
History
Date User Action Args
2022-04-11 14:57:27adminsetgithub: 58378
2021-10-22 21:57:00tim.goldensetstatus: open -> closed
resolution: out of date
messages: + msg404832

stage: resolved
2012-03-05 21:13:57loewissetmessages: + msg154975
2012-03-05 16:56:33pitrousetnosy: + tim.golden, brian.curtin
2012-03-05 16:40:34vstinnersetmessages: + msg154962
2012-03-05 16:19:35loewissetmessages: + msg154958
2012-03-02 15:33:19vstinnersetmessages: + msg154770
2012-03-02 15:24:46pitrousetnosy: + vstinner
2012-03-02 09:47:55giampaolo.rodolasetnosy: + giampaolo.rodola
2012-03-02 06:26:30loewissetnosy: + loewis
messages: + msg154740
2012-03-02 03:44:55nkxyzsettitle: print unicode string error in cmd console -> print unicode string error in win8 cmd console
2012-03-02 03:43:31nkxyzcreate