[Python-modules-team] Bug#519594: ipython: timeit on quick snippets causes UnicodeEncodeError -- microsec unicode is incorrect?

Yaroslav Halchenko debian at onerussian.com
Fri Mar 13 17:50:24 UTC 2009

Package: ipython
Version: 0.9.1-3
Severity: normal

Here is the snippet (although I guess it needs to be present on any quick but
not uber-quick function ;)) and output:

*In [2]:import scipy.stats
In [3]:import numpy as N
In [4]:cpaste 
Pasting code; enter '--' alone on the line to stop.
:def cr():
:    try:
:        scipy.stats.rdist(1.32, 0, 1).cdf(-1.0+N.finfo(float).eps)
:    except ZeroDivisionError:
:        pass

In [5]:timeit cr()
UnicodeEncodeError                        Traceback (most recent call last)

/home/yoh/proj/pymvpa/pymvpa/mvpa/tests/<ipython console> in <module>()

/var/lib/python-support/python2.5/IPython/iplib.py in ipmagic(self, arg_s)
    951         else:
    952             magic_args = self.var_expand(magic_args,1)
--> 953             return fn(magic_args)
    955     def ipalias(self,arg_s):

/var/lib/python-support/python2.5/IPython/Magic.py in magic_timeit(self, parameter_s)
   1829                                                           precision,
   1830                                                           best * scaling[order],
-> 1831                                                           units[order])
   1832         if tc > tc_min:
   1833             print "Compiler time: %.2f s" % tc

UnicodeEncodeError: 'ascii' codec can't encode character u'\xb5' in position 27: ordinal not in range(128)

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'stable'), (300, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages ipython depends on:
ii  python                        2.5.2-2    An interactive high-level object-o
ii  python-pexpect                2.1-1      Python module for automating inter
ii  python-support                0.8.7      automated rebuilding support for P

Versions of packages ipython recommends:
ii  global                      5.7.1-1      Source code search and browse tool
ii  python                      2.5.2-2      An interactive high-level object-o
ii  python-ctypes               1.0.2-5      Python package to create and manip
ii  python-foolscap             0.3.2.dfsg-1 object-capability-based RPC system
ii  python-openssl              0.7-2        Python wrapper around the OpenSSL 
ii  python-twisted-core         8.2.0-1      Event-based framework for internet
ii  python-wxgtk2.8     wxWidgets Cross-platform C++ GUI t
ii  python-zopeinterface [pytho 3.3.1-7      The implementation of interface de

Versions of packages ipython suggests:
ii  libjs-jquery                  1.2.6-1    JavaScript library for dynamic web
ii  python-gobject                2.14.2-1   Python bindings for the GObject li
ii  python-gtk2                   2.12.1-6   Python bindings for the GTK+ widge
ii  python-matplotlib             0.98.3-5   Python based plotting system in a 
ii  python-numpy                  1:1.2.1-1  Numerical Python adds a fast array
ii  python-profiler               2.5.2-1    deterministic profiling of any Pyt
ii  python-qt3                    3.17.4-1   Qt3 bindings for Python
ii  python-qt4                    4.4.2-4    Python bindings for Qt4

-- no debconf information

More information about the Python-modules-team mailing list