diff --git a/IPython/Magic.py b/IPython/Magic.py index 2aa80a3..f7105a5 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2153 2007-03-18 22:53:18Z fperez $""" +$Id: Magic.py 2187 2007-03-30 04:56:40Z fperez $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -670,8 +670,13 @@ Currently the magic system has the following functions:\n""" """Generic interface to the inspector system. This function is meant to be called by pdef, pdoc & friends.""" - - oname = oname.strip() + + try: + oname = oname.strip().encode('ascii') + except UnicodeEncodeError: + print 'Python identifiers can only contain ascii characters.' + return 'not found' + info = Struct(self._ofind(oname, namespaces)) if info.found: diff --git a/IPython/iplib.py b/IPython/iplib.py index 4783ab4..73caca6 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 2173 2007-03-23 14:26:16Z vivainio $ +$Id: iplib.py 2187 2007-03-30 04:56:40Z fperez $ """ #***************************************************************************** @@ -2382,6 +2382,7 @@ want to merge them back into the new files.""" % locals() line = line[:-1] self.log(line,'#?'+line,continue_prompt) if line: + #print 'line:<%r>' % line # dbg self.magic_pinfo(line) else: page(self.usage,screen_lines=self.rc.screen_length) diff --git a/doc/ChangeLog b/doc/ChangeLog index 98182bc..0d45e5d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2007-03-29 Fernando Perez + + * IPython/Magic.py (_inspect): convert unicode input into ascii + before trying to evaluate it as a Python identifier. This fixes a + problem that the new unicode support had introduced when analyzing + long definition lines for functions. + 2007-03-24 Walter Doerwald * IPython/Extensions/igrid.py: Fix picking. Using