[Python-modules-team] Bug#839757: ipython3: fails to start w/ non-utf8 locale if history contains utf8 byte

Felix C. Stegerman flx at obfusk.net
Tue Oct 4 16:34:46 UTC 2016


Package: ipython3
Version: 2.4.1-1
Severity: normal

Dear Maintainer,

I suddenly get this:

$ LC_ALL=C ipython3
Traceback (most recent call last):
  File "/usr/bin/ipython3", line 5, in <module>
    start_ipython()
  File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python3/dist-packages/IPython/config/application.py", line 564, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-110>", line 2, in initialize
  File "/usr/lib/python3/dist-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/IPython/terminal/ipapp.py", line 332, in initialize
    self.init_shell()
  File "/usr/lib/python3/dist-packages/IPython/terminal/ipapp.py", line 348, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "/usr/lib/python3/dist-packages/IPython/config/configurable.py", line 354, in instance
    inst = cls(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 328, in __init__
    **kwargs
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 483, in __init__
    self.init_readline()
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 1884, in init_readline
    self.refill_readline_hist()
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 1903, in refill_readline_hist
    stdin_encoding))
UnicodeEncodeError: 'locale' codec can't encode character '\xe3' in position 1: Invalid or incomplete multibyte or wide character

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev at scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

$ LC_ALL=C.UTF-8 ipython3 # now it works
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
...

$ LC_ALL=C ipython # works fine
Python 2.7.12+ (default, Sep  1 2016, 20:27:38)
...

$ mv .ipython{,_}
$ LC_ALL=C ipython3 # w/o history it works
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
...

$ python3 -c "import IPython; print(IPython.sys_info())"
{'commit_hash': 'af17558',
 'commit_source': 'installation',
 'default_encoding': 'ISO-8859-1',
 'ipython_path': '/usr/lib/python3/dist-packages/IPython',
 'ipython_version': '2.4.1',
 'os_name': 'posix',
 'platform': 'Linux-4.7.0-1-amd64-x86_64-with-debian-stretch-sid',
 'sys_executable': '/usr/bin/python3',
 'sys_platform': 'linux',
 'sys_version': '3.5.2+ (default, Sep 22 2016, 12:18:14) \n'
                '[GCC 6.2.0 20160914]'}

I decided against reporting it upsteam myself seeing as how the
version in Debian seems to be rather old.

- Felix


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ipython3 depends on:
ii  python3-decorator      4.0.6-1
ii  python3-pkg-resources  28.0.0-1
ii  python3-simplegeneric  0.8.1-1
pn  python3:any            <none>

ipython3 recommends no packages.

Versions of packages ipython3 suggests:
pn  ipython3-notebook   <none>
pn  ipython3-qtconsole  <none>
pn  python3-zmq         <none>

-- no debconf information



More information about the Python-modules-team mailing list