[Python-modules-team] Bug#455905: ipython: problems with multi-line utf-8 string
Tiago Saboga
tiagosaboga at gmail.com
Wed Dec 12 14:08:13 UTC 2007
Package: ipython
Version: 0.8.1-2
Severity: normal
When using ipython with utf-8 locale I can't define a multi-line
string with triple quotes and multi-byte chars. Session output follows.
Thanks,
Tiago Saboga.
tiago at sofocles:~$ /usr/bin/ipython
Python 2.4.4 (#2, Aug 16 2007, 00:34:54)
Type "copyright", "credits" or "license" for more information.
IPython 0.8.1 -- An enhanced Interactive Python.
? -> Introduction to IPython's features.
%magic -> Information about IPython's 'magic' % functions.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: a='ç'
In [2]: a=u'ç'
In [3]: a='''ç'''
In [4]: a=u'''ç'''
In [5]: a='''ç
...: '''
---------------------------------------------------------------------------
exceptions.UnicodeEncodeError Traceback (most recent call last)
/var/lib/python-support/python2.4/IPython/iplib.py in raw_input(self, prompt, continue_prompt)
2040 newhist = self.input_hist_raw[-1].rstrip()
2041 self.readline.remove_history_item(histlen-1)
-> 2042 self.readline.replace_history_item(histlen-2,newhist)
2043 except AttributeError:
2044 pass # re{move,place}_history_item are new in 2.4.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 5: ordinal not in range(128)
...:
KeyboardInterrupt
In [5]: a=u'''ç
...: '''
---------------------------------------------------------------------------
exceptions.UnicodeEncodeError Traceback (most recent call last)
/var/lib/python-support/python2.4/IPython/iplib.py in raw_input(self, prompt, continue_prompt)
2040 newhist = self.input_hist_raw[-1].rstrip()
2041 self.readline.remove_history_item(histlen-1)
-> 2042 self.readline.replace_history_item(histlen-2,newhist)
2043 except AttributeError:
2044 pass # re{move,place}_history_item are new in 2.4.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 6: ordinal not in range(128)
...:
KeyboardInterrupt
In [6]: a=u"""ç
...: """
---------------------------------------------------------------------------
exceptions.UnicodeEncodeError Traceback (most recent call last)
/var/lib/python-support/python2.4/IPython/iplib.py in raw_input(self, prompt, continue_prompt)
2040 newhist = self.input_hist_raw[-1].rstrip()
2041 self.readline.remove_history_item(histlen-1)
-> 2042 self.readline.replace_history_item(histlen-2,newhist)
2043 except AttributeError:
2044 pass # re{move,place}_history_item are new in 2.4.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 6: ordinal not in range(128)
...:
KeyboardInterrupt
In [7]:
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable'), (50, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.22sofocles1 (SMP w/1 CPU core)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages ipython depends on:
ii python 2.4.4-6 An interactive high-level object-o
ii python-pexpect 2.1-1 Python module for automating inter
ii python-support 0.7.5 automated rebuilding support for p
ipython recommends no packages.
-- no debconf information
More information about the Python-modules-team
mailing list