New submission from wujek <wujek.sru...@googlemail.com>: The following code produces an exception:
print('{:c}'.format(65536)) when executed in Idle 3.2. The stack trace: >>> print('{:c}'.format(65536)) Traceback (most recent call last): File "<pyshell#149>", line 1, in <module> print('{:c}'.format(65536)) File "/usr/lib/python3.2/idlelib/PyShell.py", line 1231, in write self.shell.write(s, self.tags) File "/usr/lib/python3.2/idlelib/PyShell.py", line 1213, in write OutputWindow.write(self, s, tags, "iomark") File "/usr/lib/python3.2/idlelib/OutputWindow.py", line 40, in write self.text.insert(mark, s, tags) File "/usr/lib/python3.2/idlelib/Percolator.py", line 25, in insert self.top.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/ColorDelegator.py", line 79, in insert self.delegate.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/PyShell.py", line 316, in insert UndoDelegator.insert(self, index, chars, tags) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 81, in insert self.addcmd(InsertCommand(index, chars, tags)) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 116, in addcmd cmd.do(self.delegate) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 219, in do text.insert(self.index1, self.chars, self.tags) File "/usr/lib/python3.2/idlelib/ColorDelegator.py", line 79, in insert self.delegate.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/WidgetRedirector.py", line 104, in __call__ return self.tk_call(self.orig_and_operation + args) ValueError: unsupported character Seems to work fine in a terminal (Gnome-terminal in this case): >>> print('{:c}'.format(0x10000)) đ (my font doesn't have the glyph, but otherwise it works) Python version: >>> print(sys.version) 3.2 (r32:88445, Mar 25 2011, 19:56:22) [GCC 4.5.2] Os: wujek@home:~$ uname -a Linux studio 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux wujek@home:~$ cat /etc/issue Ubuntu 11.04 ---------- components: IDLE, IO messages: 138389 nosy: wujek.srujek priority: normal severity: normal status: open title: characters with ord above 65535 fail conversion with str.format for '{:c}' in IDLE type: behavior versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12342> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com