Debian Bug report logs - #565351
ipython: %psearch causes TypeError: expected string or buffer

version graph

Package: ipython; Maintainer for ipython is Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>; Source for ipython is src:ipython.

Reported by: Yaroslav Halchenko <debian@onerussian.com>

Date: Fri, 15 Jan 2010 00:15:01 UTC

Severity: normal

Tags: fixed-upstream

Found in version ipython/0.10-1

Fixed in version ipython/0.11-1

Forwarded to http://github.com/ipython/ipython/issues/issue/129

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, fperez.net@gmail.com, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#565351; Package ipython. (Fri, 15 Jan 2010 00:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yaroslav Halchenko <debian@onerussian.com>:
New Bug report received and forwarded. Copy sent to fperez.net@gmail.com, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Fri, 15 Jan 2010 00:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Yaroslav Halchenko <debian@onerussian.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ipython: %psearch causes TypeError: expected string or buffer
Date: Thu, 14 Jan 2010 19:13:03 -0500
Package: ipython
Version: 0.10-1
Severity: normal


I've ran into this issue many times and finally decided to report ;)

In [1]: import numpy

In [2]: %psearch numpy.*.*s
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/usr/lib/pymodules/python2.5/IPython/OInspect.pyc in psearch(self, pattern, ns_table, ns_search, ignore_case, show_all)
    601             tmp_res = list(list_namespace(ns,type_pattern,filter,
    602                                           ignore_case=ignore_case,
--> 603                                           show_all=show_all))
    604             search_result.extend(tmp_res)
    605         search_result.sort()

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in list_namespace(namespace, type_pattern, filter, ignore_case, show_all)
    144         for name,obj in nsdict.iteritems():
    145             ns=list_namespace(obj,type_pattern,".".join(pattern_list[1:]),
--> 146                               ignore_case=ignore_case,show_all=show_all)
    147             for inner_name,inner_obj in ns.iteritems():
    148                 res["%s.%s"%(name,inner_name)]=inner_obj

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in list_namespace(namespace, type_pattern, filter, ignore_case, show_all)
    144         for name,obj in nsdict.iteritems():
    145             ns=list_namespace(obj,type_pattern,".".join(pattern_list[1:]),
--> 146                               ignore_case=ignore_case,show_all=show_all)
    147             for inner_name,inner_obj in ns.iteritems():
    148                 res["%s.%s"%(name,inner_name)]=inner_obj

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in list_namespace(namespace, type_pattern, filter, ignore_case, show_all)
    133         ns=NameSpace(namespace,name_pattern=pattern_list[0],type_pattern=type_pattern,
    134                      ignore_case=ignore_case,show_all=show_all)
--> 135         return ns.ns
    136     else:
    137         # This is where we can change if all objects should be searched or

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in get_ns(self)
     95     def get_ns(self):
     96         """Return name space dictionary with objects matching type and name patterns."""
---> 97         return self.filter(self.name_pattern,self.type_pattern)
     98     ns=property(get_ns)
     99 

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in filter(self, name_pattern, type_pattern)
    118         #Filter namespace by the name_pattern
    119         all=[(x,ns[x]) for x in glob_filter(ns.keys(),name_pattern,
--> 120                                             self.show_all,self.ignore_case)]
    121         #Filter namespace by type_pattern
    122         all=[(key,obj) for key,obj in all if is_type(obj,type_pattern)]

/usr/lib/pymodules/python2.5/IPython/wildcard.pyc in glob_filter(lista, name_pattern, hidehidden, ignore_case)
    113             else:
    114                 reg=re.compile(pattern+"$")
--> 115             result=[x for x in lista if reg.match(x) and show_hidden(x,hidehidden)]
    116             return result
    117         ns=self._ns

TypeError: expected string or buffer


happens with
ipdb> p lista
[<type 'numpy.void'>, <type 'numpy.float128'>, 'f4', <type 'numpy.int8'>, 'f8', <type 'numpy.float64'>, 'Complex128', <type 'numpy.int32'>, <type 'numpy.int16'>, 'Bool', 'b1', <type 'numpy.string_'>, 'String0', 'q', <type 'numpy.complex64'>, 'Complex64', 'G', 'u4', <type 'numpy.int64'>, 'Unicode0', 'u1', <type 'numpy.complex128'>, 'u2', 'i1', 'UInt16', 'Float32', <type 'numpy.int64'>, 'Int64', <type 'numpy.complex256'>, 'c16', '?', 'Void0', <type 'numpy.bool_'>, 'i8', <type 'numpy.uint8'>, 'B', 'D', <type 'numpy.object_'>, 'F', 'I', 'H', 'i2', <type 'numpy.uint16'>, 'L', 'O', 'i4', 'Q', 'S', 'c8', 'U', 'Int8', 'Complex32', 'V', <type 'numpy.uint32'>, <type 'numpy.unicode_'>, 'u8', 'UInt64', 'Float64', 'b', 'd', 'g', 'f', 'i', 'h', 'UInt8', 'l', 'UInt32', 'Object0', <type 'numpy.uint64'>, 'Float128', <type 'numpy.uint64'>, 'c32', 'f16', 'Int16', <type 'numpy.float32'>, 'Int32']

ipdb>  reg.match(lista[0])
*** TypeError: expected string or buffer


I guess safest way would be to check first if x is a string at all ;)


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (901, 'unstable'), (900, 'testing'), (300, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ipython depends on:
ii  python                        2.5.4-5    An interactive high-level object-o
ii  python-pexpect                2.3-1      Python module for automating inter
ii  python-support                1.0.3      automated rebuilding support for P

Versions of packages ipython recommends:
ii  global                      5.7.1-1      Source code search and browse tool
ii  python [python-ctypes]      2.5.4-5      An interactive high-level object-o
ii  python-ctypes               1.0.2-6      Python package to create and manip
ii  python-foolscap             0.4.2+dfsg-1 object-capability-based RPC system
ii  python-openssl              0.9-1        Python wrapper around the OpenSSL 
ii  python-twisted-core         8.2.0-3      Event-based framework for internet
ii  python-wxgtk2.8             2.8.7.1-2+b1 wxWidgets Cross-platform C++ GUI t
pn  python-zope.interface       <none>       (no description available)

Versions of packages ipython suggests:
ii  libjs-jquery                  1.3.3-2    JavaScript library for dynamic web
ii  python-gobject                2.16.1-1   Python bindings for the GObject li
ii  python-gtk2                   2.16.0-1   Python bindings for the GTK+ widge
ii  python-matplotlib             0.99.0-1   Python based plotting system in a 
ii  python-numpy                  1:1.3.0-3  Numerical Python adds a fast array
ii  python-profiler               2.5.2-1    deterministic profiling of any Pyt
ii  python-qt4                    4.6-1      Python bindings for Qt4

-- debconf-show failed




Set Bug forwarded-to-address to 'http://github.com/ipython/ipython/issues/issue/129'. Request was from Yaroslav Halchenko <debian@onerussian.com> to control@bugs.debian.org. (Mon, 21 Jun 2010 15:18:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#565351; Package ipython. (Wed, 23 Feb 2011 22:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Kluyver <takowl@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Wed, 23 Feb 2011 22:15:03 GMT) Full text and rfc822 format available.

Message #12 received at 565351@bugs.debian.org (full text, mbox):

From: Thomas Kluyver <takowl@gmail.com>
To: 565351@bugs.debian.org, Fernando Perez <fperez.net@gmail.com>
Subject: Bug fixed in trunk
Date: Wed, 23 Feb 2011 22:11:28 +0000
[Message part 1 (text/plain, inline)]
Hi,

Thanks for the bug report. It's been fixed in trunk (which will become v
0.11). For more details, see the pull request here:
https://github.com/ipython/ipython/pull/251

Best wishes,
Thomas
[Message part 2 (text/html, inline)]

Added tag(s) fixed-upstream. Request was from Julian Taylor <jtaylor.debian@googlemail.com> to control@bugs.debian.org. (Thu, 24 Feb 2011 14:45:04 GMT) Full text and rfc822 format available.

Bug Marked as fixed in versions ipython/0.11-1. Request was from Julian Taylor <jtaylor.debian@googlemail.com> to control@bugs.debian.org. (Mon, 22 Aug 2011 15:21:07 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 10:18:27 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.