[IPython-dev] Another unicode problem

Jörgen Stenarson jorgen.stenarson at bostream.nu
Mon Sep 17 13:20:38 EDT 2007


hi,

there is another problem with unicode handling.

If I try to issue the magic command cd with a path containing swedish 
characters I get a UnicodeError.


/Jörgen

c:\python\packages>ipython
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 0.8.2.svn.r2750 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: cd åäö
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)

C:\python\ipython\IPython\iplib.py in 
multiline_prefilter(self=<IPython.iplib.InteractiveShell objec
t>, line=u'cd \xe5\xe4\xf6', continue_prompt=0)
    2148
    2149
-> 2150
    2151
    2152

C:\python\ipython\IPython\iplib.py in 
_prefilter(self=<IPython.iplib.InteractiveShell object>, line=
u'cd \xe5\xe4\xf6', continue_prompt=0)
    2130
    2131
-> 2132
    2133
    2134

C:\python\ipython\IPython\prefilter.py in 
prefilter(line_info=<IPython.prefilter.LineInfo object>, i
p=<IPython.iplib.InteractiveShell object>)
     149
     150
--> 151
     152
     153

C:\python\ipython\IPython\iplib.py in 
handle_magic(self=<IPython.iplib.InteractiveShell object>, lin
e_info=<IPython.prefilter.LineInfo object>)
    2224
    2225
-> 2226
    2227
    2228

C:\python\ipython\IPython\genutils.py in make_quoted_expr(s=u'cd 
\xe5\xe4\xf6')
    1105
    1106
-> 1107
    1108
    1109

c:\python\external\ipython\IPython\Itpl.py in 
itpl(text='$raw$quote$s$tailpadding$quote$tail')
     250
     251 # utilities for fast printing
--> 252 def itpl(text): return str(Itpl(text))
         global itpl = <function itpl at 0x00B477F0>
         text = '$raw$quote$s$tailpadding$quote$tail'
         global str = undefined
         global Itpl = <class IPython.Itpl.Itpl at 0x00B42A80>
     253 def printpl(text): print itpl(text)
     254 # versions with namespace

c:\python\external\ipython\IPython\Itpl.py in __str__(self=<Itpl 
'$raw$quote$s$tailpadding$quote$tai
l' >)
     216         loc, glob = frame.f_locals, frame.f_globals
     217
--> 218         return self._str(glob,loc)
         self._str = <bound method Itpl._str of <Itpl 
'$raw$quote$s$tailpadding$quote$tail' >>
         glob = {'make_quoted_expr': <function make_quoted_expr at 
0x00C6ECF0>, 'NotGiven': <class IP
ython.genutils.NotGiven at 0x011C9F00>, 'list_strings': <function 
list_strings at 0x00C6EF30>, 'Erro
r': <class IPython.genutils.Error at 0x00B79840>, 'Release': <module 
'IPython.Release' from 'c:\pyth
on\external\ipython\IPython\Release.pyc'>, 'clocks': <built-in function 
clock>, 'clocku': <built-in
function clock>, 'esc_quotes': <function esc_quotes at 0x00C6ECB0>, 
'msvcrt': <module 'msvcrt' (buil
t-in)>, 'target_update': <function target_update at 0x00C6E6F0>, 
'tempfile': <module 'tempfile' from
  'C:\Python24\lib\tempfile.pyc'>, 'page_more': <function page_more at 
0x011CA1B0>, 'map_method': <fu
nction map_method at 0x011CA6B0>, 'list2dict2': <function list2dict2 at 
0x011CA4F0>, 'fatal': <funct
ion fatal at 0x00B7EC70>, 'info': <function info at 0x00B7E130>, 
'DPyGetOpt': <module 'IPython.DPyGe
tOpt' from 'c:\python\external\ipython\IPython\DPyGetOpt.pyc'>, 
'result_display': <function result_d
isplay at 0x00A2BF70>, 'platutils': <module 'IPython.platutils' from 
'c:\python\external\ipython\IPy
thon\platutils.pyc'>, '__file__': 
'c:\\python\\external\\ipython\\IPython\\genutils.pyc', 'setattr_l
ist': <function setattr_list at 0x011CA630>, 'clock2': <function clock2 
at 0x00B86BF0>, 'timing': <f
unction timing at 0x00C57AB0>, 'getattr_list': <function getattr_list at 
0x011CA670>, 'dgrep': <func
tion dgrep at 0x00C6EFB0>, 'qw': <function qw at 0x00C6EE30>, 'marquee': 
<function marquee at 0x00C6
EDF0>, 'mutex_opts': <function mutex_opts at 0x00C6E5B0>, 'igrep': 
<function igrep at 0x011CA070>, '
native_line_ends': <function native_line_ends at 0x011CA0F0>, 
'get_class_members': <function get_cla
ss_members at 0x011CA6F0>, 'shlex': <module 'shlex' from 
'C:\Python24\lib\shlex.pyc'>, 'doctest_relo
ad': <function doctest_reload at 0x00C6E970>, 'arg_split': <function 
arg_split at 0x00C6E530>, 'page
': <function page at 0x011CA230>, 'dir2': <function dir2 at 0x011CA730>, 
'IOTerm': <class IPython.ge
nutils.IOTerm at 0x00B79900>, 'EvalDict': <class 
IPython.genutils.EvalDict at 0x011C9E70>, 'unquote_
ends': <function unquote_ends at 0x00C6E7F0>, 'flatten': <function 
flatten at 0x011CA530>, 'LSString
': <class 'IPython.genutils.LSString'>, 'process_cmdline': <function 
process_cmdline at 0x00C6E830>,
  'IOStream': <class IPython.genutils.IOStream at 0x00B798A0>, 'idgrep': 
<function idgrep at 0x011CA0
30>, 'clock': <built-in function clock>, 'page_file': <function 
page_file at 0x011CA270>, 're': <mod
ule 're' from 'C:\Python24\lib\re.pyc'>, 'get_console_size': <function 
get_console_size at 0x00B77D7
0>, 'StringTypes': (<type 'str'>, <type 'unicode'>), 'qw_lol': <function 
qw_lol at 0x00C6EEF0>, 'pri
ntpl': <function printpl at 0x00B479F0>, 'Term': 
<IPython.genutils.IOTerm instance at 0x00C588C8>, '
__builtins__': {'IndexError': <class exceptions.IndexError at 
0x009B4BD0>, 'help': Type help() for i
nteractive help, or help(object) for help about object., 'vars': 
<built-in function vars>, 'SyntaxEr
ror': <class exceptions.SyntaxError at 0x009B4A50>, '__IPYTHON__active': 
1, 'unicode': <type 'unicod
e'>, 'UnicodeDecodeError': <class exceptions.UnicodeDecodeError at 
0x009B4F90>, 'isinstance': <built
-in function isinstance>, 'copyright': Copyright (c) 2001-2006 Python 
Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.

     Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
     All Rights Reserved., 'NameError': <class exceptions.NameError at 
0x009B4930>, 'dict': <type 'di
ct'>, 'input': <built-in function input>, 'oct': <built-in function 
oct>, 'SystemExit': <class excep
tions.SystemExit at 0x009B45D0>, 'StandardError': <class 
exceptions.StandardError at 0x009B4570>, 'r
epr': <built-in function repr>, 'ipmagic': <function newFunc at 
0x011D21B0>, 'sorted': <built-in fun
ction sorted>, 'False': False, 'RuntimeWarning': <class 
exceptions.RuntimeWarning at 0x009C72D0>, 'l
ist': <type 'list'>, 'iter': <built-in function iter>, 'reload': 
<built-in function reload>, 'Warnin
g': <class exceptions.Warning at 0x009C7150>, 'round': <built-in 
function round>, 'dir': <built-in f
unction dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 
'reduce': <built-in function redu
ce>, 'intern': <built-in function intern>, 'issubclass': <built-in 
function issubclass>, 'Ellipsis':
  Ellipsis, 'EOFError': <class exceptions.EOFError at 0x009B4810>, 
'locals': <built-in function local
s>, 'slice': <type 'slice'>, 'FloatingPointError': <class 
exceptions.FloatingPointError at 0x009B4D8
0>, 'sum': <built-in function sum>, 'OverflowWarning': <class 
exceptions.OverflowWarning at 0x009C72
A0>, 'getattr': <built-in function getattr>, 'abs': <built-in function 
abs>, 'exit': Type exit() to
exit., 'True': True, 'FutureWarning': <class exceptions.FutureWarning at 
0x009C7300>, 'None': None,
'hash': <built-in function hash>, 'len': <built-in function len>, 'credits':
     Python:     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a 
cast of thousands
     for supporting Python development.  See www.python.org for more 
information.

     IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
     See http://ipython.scipy.org for more information., 'frozenset': 
<type 'frozenset'>, '__name__':
  '__builtin__', 'ord': <built-in function ord>, 'super': <type 
'super'>, 'TypeError': <class excepti
ons.TypeError at 0x009B45A0>, 'license': Type license() to see the full 
license text, 'KeyboardInter
rupt': <class exceptions.KeyboardInterrupt at 0x009B4630>, 
'UserWarning': <class exceptions.UserWarn
ing at 0x009C7180>, 'filter': <built-in function filter>, 'range': 
<built-in function range>, 'stati
cmethod': <type 'staticmethod'>, 'SystemError': <class 
exceptions.SystemError at 0x009C70F0>, 'ipali
as': <function newFunc at 0x011D20B0>, 'pow': <built-in function pow>, 
'RuntimeError': <class except
ions.RuntimeError at 0x009B4840>, 'float': <type 'float'>, 
'StopIteration': <class exceptions.StopIt
eration at 0x009B4540>, 'globals': <built-in function globals>, 
'divmod': <built-in function divmod>
, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 
'LookupError': <class excepti
ons.LookupError at 0x009B4BA0>, 'open': <type 'file'>, 'quit': Type 
quit() to exit., 'basestring': <
type 'basestring'>, 'UnicodeError': <class exceptions.UnicodeError at 
0x009B4E40>, 'zip': <built-in
function zip>, 'ipsystem': <function newFunc at 0x011D2270>, 'hex': 
<built-in function hex>, 'long':
  <type 'long'>, 'ReferenceError': <class exceptions.ReferenceError at 
0x009C70C0>, 'ImportError': <c
lass exceptions.ImportError at 0x009B4690>, 'chr': <built-in function 
chr>, 'ip_set_hook': <bound me
thod InteractiveShell.set_hook of <IPython.iplib.InteractiveShell object 
at 0x00A22BB0>>, 'xrange':
<type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, 
exceptions, and other object
s.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in 
slices.", 'Exception': <cla
ss exceptions.Exception at 0x009B4510>, '__IPYTHON__': 
<IPython.iplib.InteractiveShell object at 0x0
0A22BB0>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <class 
exceptions.UnicodeTranslateError
at 0x009C7060>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': 
<class exceptions.UnicodeEncode
Error at 0x009B4ED0>, 'IOError': <class exceptions.IOError at 
0x009B4720>, 'hasattr': <built-in func
tion hasattr>, 'delattr': <built-in function delattr>, 'jobs': 
<IPython.background_jobs.BackgroundJo
bManager instance at 0x00A30508>, 'setattr': <built-in function 
setattr>, 'raw_input': <built-in fun
ction raw_input>, 'SyntaxWarning': <class exceptions.SyntaxWarning at 
0x009C7270>, 'compile': <built
-in function compile>, 'ArithmeticError': <class 
exceptions.ArithmeticError at 0x009B4C60>, 'str': <
type 'str'>, 'property': <type 'property'>, 'dreload': <function reload 
at 0x013012F0>, 'MemoryError
': <class exceptions.MemoryError at 0x009C7120>, 'int': <type 'int'>, 
'__import__': <built-in functi
on __import__>, 'KeyError': <class exceptions.KeyError at 0x009B4C30>, 
'coerce': <built-in function
coerce>, 'PendingDeprecationWarning': <class 
exceptions.PendingDeprecationWarning at 0x009C7240>, 'f
ile': <type 'file'>, 'EnvironmentError': <class 
exceptions.EnvironmentError at 0x009B46C0>, 'unichr'
: <built-in function unichr>, '_ip': <IPython.ipapi.IPApi instance at 
0x012F4B70>, 'id': <built-in f
unction id>, 'OSError': <class exceptions.OSError at 0x009B4780>, 
'DeprecationWarning': <class excep
tions.DeprecationWarning at 0x009C71E0>, 'min': <built-in function min>, 
'execfile': <built-in funct
ion execfile>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 
'ValueError': <class exceptions.V
alueError at 0x009B4DE0>, 'NotImplemented': NotImplemented, 'map': 
<built-in function map>, 'buffer'
: <type 'buffer'>, 'max': <built-in function max>, 'object': <type 
'object'>, 'TabError': <class exc
eptions.TabError at 0x009B4B10>, 'callable': <built-in function 
callable>, 'ZeroDivisionError': <cla
ss exceptions.ZeroDivisionError at 0x009B4CF0>, 'eval': <built-in 
function eval>, '__debug__': True,
  'IndentationError': <class exceptions.IndentationError at 0x009B4AE0>, 
'AssertionError': <class exc
eptions.AssertionError at 0x009B4B70>, 'classmethod': <type 
'classmethod'>, 'UnboundLocalError': <cl
ass exceptions.UnboundLocalError at 0x009B4990>, 'NotImplementedError': 
<class exceptions.NotImpleme
ntedError at 0x009B48A0>, 'AttributeError': <class 
exceptions.AttributeError at 0x009B4A20>, 'Overfl
owError': <class exceptions.OverflowError at 0x009B4C90>, 
'WindowsError': <class exceptions.WindowsE
rror at 0x009B47B0>}, 'debugx': <function debugx at 0x00B7E170>, 'bq': 
<function getoutput at 0x00C6
E6B0>, '__name__': 'IPython.genutils', 'read_dict': <function read_dict 
at 0x00C6E8B0>, 'list2dict':
  <function list2dict at 0x011CA4B0>, 'uniq_stable': <function 
uniq_stable at 0x011CA330>, 'commands'
: <module 'commands' from 'C:\Python24\lib\commands.pyc'>, 'indent': 
<function indent at 0x011CA0B0>
, 'popkey': <function popkey at 0x011CA7B0>, 'timings': <function 
timings at 0x00C579F0>, 'chop': <f
unction chop at 0x011CA5B0>, 'doctest': <module 'doctest' from 
'C:\Python24\lib\doctest.pyc'>, 'get_
home_dir': <function get_home_dir at 0x00C6E9B0>, 'esc_re': 
<_sre.SRE_Pattern object at 0x00BA5F20>,
  'os': <module 'os' from 'C:\Python24\lib\os.pyc'>, 'import_fail_info': 
<function import_fail_info a
t 0x011CA770>, 'SList': <class 'IPython.genutils.SList'>, 'filefind': 
<function filefind at 0x00C6E4
70>, 'get_pager_cmd': <function get_pager_cmd at 0x011CA130>, 
'all_belong': <function all_belong at
0x011CA370>, 'path': <class 'path.path'>, 'IPython': <module 'IPython' 
from 'c:\python\external\ipyt
hon\IPython\__init__.pyc'>, 'mkdict': <function mkdict at 0x011CA470>, 
'SystemExec': <class IPython.
genutils.SystemExec at 0x00C544E0>, 'snip_print': <function snip_print 
at 0x011CA2B0>, 'HomeDirError
': <class IPython.genutils.HomeDirError at 0x011C9360>, 'system': 
<function system at 0x00C6E3B0>, '
getoutput': <function getoutput at 0x00C6E6B0>, 'print_slist': <function 
print_slist at 0x00C6EB30>,
  'types': <module 'types' from 'C:\Python24\lib\types.pyc'>, 
'with_obj': <function with_obj at 0x011
CA5F0>, '__doc__': '\nGeneral purpose utilities.\n\nThis is a grab-bag 
of stuff I find useful in mos
t programs I write. Some of\nthese things are also convenient when 
working at the command line.\n\n$
Id: genutils.py 2763 2007-09-14 06:35:44Z fperez $', 'shell': <function 
shell at 0x00C6E4B0>, 'page_
dumb': <function page_dumb at 0x011CA1F0>, 'getoutputerror': <function 
getoutputerror at 0x00C6E570>
, '__author__': 'Fernando Perez <fperez at colorado.edu>', 'warn': 
<function warn at 0x00B77CB0>, 'ask_
yes_no': <function ask_yes_no at 0x00C6EDB0>, 'qwflat': <function qwflat 
at 0x00C6EEB0>, 'Itpl': <cl
ass IPython.Itpl.Itpl at 0x00B42A80>, 'file_readlines': <function 
file_readlines at 0x00C6E730>, 'gr
ep': <function grep at 0x00C6EF70>, 'raw_input_multi': <function 
raw_input_multi at 0x00C6ED30>, 'er
ror': <function error at 0x00B7E0F0>, 'sort_compare': <function 
sort_compare at 0x011CA430>, 'optstr
2types': <function optstr2types at 0x00C6E870>, 'EvalString': <class 
IPython.genutils.EvalDict at 0x
011C9E70>, 'NLprinter': <class IPython.genutils.NLprinter at 
0x011C9ED0>, 'flag_calls': <function fl
ag_calls at 0x00C6E8F0>, 'dhook_wrap': <function dhook_wrap at 
0x00C6E930>, '__main__': <module '__m
ain__' from 'c:\python24\scripts\ipython.py'>, 'shutil': <module 
'shutil' from 'C:\Python24\lib\shut
il.pyc'>, '__license__': 'BSD', 'belong': <function belong at 
0x011CA2F0>, 'abbrev_cwd': <function a
bbrev_cwd at 0x00C6E330>, 'get_slice': <function get_slice at 
0x011CA570>, 'get_pager_start': <funct
ion get_pager_start at 0x011CA170>, 'file_read': <function file_read at 
0x00C6E7B0>, 'nlprint': <IPy
thon.genutils.NLprinter instance at 0x011DDE40>, 'warnings': <module 
'warnings' from 'C:\Python24\li
b\warnings.pyc'>, 'timings_out': <function timings_out at 0x00C57AF0>, 
'sys': <module 'sys' (built-i
n)>, 'readline': <module 'IPython.rlineimpl' from 
'c:\python\external\ipython\IPython\rlineimpl.pyc'
 >, 'xsys': <function system at 0x00C6E3B0>, 'shell_ori': <function 
shell at 0x00C6E430>, 'get_py_fil
ename': <function get_py_filename at 0x00C6E3F0>, 'print_lsstring': 
<function print_lsstring at 0x00
C6E9F0>, 'time': <module 'time' (built-in)>, 'target_outdated': 
<function target_outdated at 0x00C6E
770>, 'wrap_deprecated': <function wrap_deprecated at 0x011CA7F0>, 
'raw_input_ext': <function raw_in
put_ext at 0x00C6ED70>, 'itpl': <function itpl at 0x00B477F0>}
         loc = {'raw': '', 'tail': '', 's': u'cd \xe5\xe4\xf6', 
'tailpadding': '', 'quote': '"'}
     219
     220 class ItplNS(Itpl):

c:\python\external\ipython\IPython\Itpl.py in _str(self=<Itpl 
'$raw$quote$s$tailpadding$quote$tail'
 >, glob={'DPyGetOpt': <module 'IPython.DPyGetOpt' from 
'c:\python\external\ipython\IPython\DPyGetOpt
.pyc'>, 'Error': <class IPython.genutils.Error>, 'EvalDict': <class 
IPython.genutils.EvalDict>, 'Eva
lString': <class IPython.genutils.EvalDict>, 'HomeDirError': <class 
IPython.genutils.HomeDirError>,
'IOStream': <class IPython.genutils.IOStream>, 'IOTerm': <class 
IPython.genutils.IOTerm>, 'IPython':
  <module 'IPython' from 
'c:\python\external\ipython\IPython\__init__.pyc'>, 'Itpl': <class IPython.I
tpl.Itpl>, 'LSString': <class 'IPython.genutils.LSString'>, ...}, 
loc={'quote': '"', 'raw': '', 's':
  u'cd \xe5\xe4\xf6', 'tail': '', 'tailpadding': ''})
     199         app = result.append
     200         for live, chunk in self.chunks:
--> 201             if live: app(str(eval(chunk,glob,loc)))
         live = 1
         app = <built-in method append of list object at 0x01B29E18>
         global str = undefined
         global eval = undefined
         chunk = 's'
         glob = {'make_quoted_expr': <function make_quoted_expr at 
0x00C6ECF0>, 'NotGiven': <class IP
ython.genutils.NotGiven at 0x011C9F00>, 'list_strings': <function 
list_strings at 0x00C6EF30>, 'Erro
r': <class IPython.genutils.Error at 0x00B79840>, 'Release': <module 
'IPython.Release' from 'c:\pyth
on\external\ipython\IPython\Release.pyc'>, 'clocks': <built-in function 
clock>, 'clocku': <built-in
function clock>, 'esc_quotes': <function esc_quotes at 0x00C6ECB0>, 
'msvcrt': <module 'msvcrt' (buil
t-in)>, 'target_update': <function target_update at 0x00C6E6F0>, 
'tempfile': <module 'tempfile' from
  'C:\Python24\lib\tempfile.pyc'>, 'page_more': <function page_more at 
0x011CA1B0>, 'map_method': <fu
nction map_method at 0x011CA6B0>, 'list2dict2': <function list2dict2 at 
0x011CA4F0>, 'fatal': <funct
ion fatal at 0x00B7EC70>, 'info': <function info at 0x00B7E130>, 
'DPyGetOpt': <module 'IPython.DPyGe
tOpt' from 'c:\python\external\ipython\IPython\DPyGetOpt.pyc'>, 
'result_display': <function result_d
isplay at 0x00A2BF70>, 'platutils': <module 'IPython.platutils' from 
'c:\python\external\ipython\IPy
thon\platutils.pyc'>, '__file__': 
'c:\\python\\external\\ipython\\IPython\\genutils.pyc', 'setattr_l
ist': <function setattr_list at 0x011CA630>, 'clock2': <function clock2 
at 0x00B86BF0>, 'timing': <f
unction timing at 0x00C57AB0>, 'getattr_list': <function getattr_list at 
0x011CA670>, 'dgrep': <func
tion dgrep at 0x00C6EFB0>, 'qw': <function qw at 0x00C6EE30>, 'marquee': 
<function marquee at 0x00C6
EDF0>, 'mutex_opts': <function mutex_opts at 0x00C6E5B0>, 'igrep': 
<function igrep at 0x011CA070>, '
native_line_ends': <function native_line_ends at 0x011CA0F0>, 
'get_class_members': <function get_cla
ss_members at 0x011CA6F0>, 'shlex': <module 'shlex' from 
'C:\Python24\lib\shlex.pyc'>, 'doctest_relo
ad': <function doctest_reload at 0x00C6E970>, 'arg_split': <function 
arg_split at 0x00C6E530>, 'page
': <function page at 0x011CA230>, 'dir2': <function dir2 at 0x011CA730>, 
'IOTerm': <class IPython.ge
nutils.IOTerm at 0x00B79900>, 'EvalDict': <class 
IPython.genutils.EvalDict at 0x011C9E70>, 'unquote_
ends': <function unquote_ends at 0x00C6E7F0>, 'flatten': <function 
flatten at 0x011CA530>, 'LSString
': <class 'IPython.genutils.LSString'>, 'process_cmdline': <function 
process_cmdline at 0x00C6E830>,
  'IOStream': <class IPython.genutils.IOStream at 0x00B798A0>, 'idgrep': 
<function idgrep at 0x011CA0
30>, 'clock': <built-in function clock>, 'page_file': <function 
page_file at 0x011CA270>, 're': <mod
ule 're' from 'C:\Python24\lib\re.pyc'>, 'get_console_size': <function 
get_console_size at 0x00B77D7
0>, 'StringTypes': (<type 'str'>, <type 'unicode'>), 'qw_lol': <function 
qw_lol at 0x00C6EEF0>, 'pri
ntpl': <function printpl at 0x00B479F0>, 'Term': 
<IPython.genutils.IOTerm instance at 0x00C588C8>, '
__builtins__': {'IndexError': <class exceptions.IndexError at 
0x009B4BD0>, 'help': Type help() for i
nteractive help, or help(object) for help about object., 'vars': 
<built-in function vars>, 'SyntaxEr
ror': <class exceptions.SyntaxError at 0x009B4A50>, '__IPYTHON__active': 
1, 'unicode': <type 'unicod
e'>, 'UnicodeDecodeError': <class exceptions.UnicodeDecodeError at 
0x009B4F90>, 'isinstance': <built
-in function isinstance>, 'copyright': Copyright (c) 2001-2006 Python 
Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.

     Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
     All Rights Reserved., 'NameError': <class exceptions.NameError at 
0x009B4930>, 'dict': <type 'di
ct'>, 'input': <built-in function input>, 'oct': <built-in function 
oct>, 'SystemExit': <class excep
tions.SystemExit at 0x009B45D0>, 'StandardError': <class 
exceptions.StandardError at 0x009B4570>, 'r
epr': <built-in function repr>, 'ipmagic': <function newFunc at 
0x011D21B0>, 'sorted': <built-in fun
ction sorted>, 'False': False, 'RuntimeWarning': <class 
exceptions.RuntimeWarning at 0x009C72D0>, 'l
ist': <type 'list'>, 'iter': <built-in function iter>, 'reload': 
<built-in function reload>, 'Warnin
g': <class exceptions.Warning at 0x009C7150>, 'round': <built-in 
function round>, 'dir': <built-in f
unction dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 
'reduce': <built-in function redu
ce>, 'intern': <built-in function intern>, 'issubclass': <built-in 
function issubclass>, 'Ellipsis':
  Ellipsis, 'EOFError': <class exceptions.EOFError at 0x009B4810>, 
'locals': <built-in function local
s>, 'slice': <type 'slice'>, 'FloatingPointError': <class 
exceptions.FloatingPointError at 0x009B4D8
0>, 'sum': <built-in function sum>, 'OverflowWarning': <class 
exceptions.OverflowWarning at 0x009C72
A0>, 'getattr': <built-in function getattr>, 'abs': <built-in function 
abs>, 'exit': Type exit() to
exit., 'True': True, 'FutureWarning': <class exceptions.FutureWarning at 
0x009C7300>, 'None': None,
'hash': <built-in function hash>, 'len': <built-in function len>, 'credits':
     Python:     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a 
cast of thousands
     for supporting Python development.  See www.python.org for more 
information.

     IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
     See http://ipython.scipy.org for more information., 'frozenset': 
<type 'frozenset'>, '__name__':
  '__builtin__', 'ord': <built-in function ord>, 'super': <type 
'super'>, 'TypeError': <class excepti
ons.TypeError at 0x009B45A0>, 'license': Type license() to see the full 
license text, 'KeyboardInter
rupt': <class exceptions.KeyboardInterrupt at 0x009B4630>, 
'UserWarning': <class exceptions.UserWarn
ing at 0x009C7180>, 'filter': <built-in function filter>, 'range': 
<built-in function range>, 'stati
cmethod': <type 'staticmethod'>, 'SystemError': <class 
exceptions.SystemError at 0x009C70F0>, 'ipali
as': <function newFunc at 0x011D20B0>, 'pow': <built-in function pow>, 
'RuntimeError': <class except
ions.RuntimeError at 0x009B4840>, 'float': <type 'float'>, 
'StopIteration': <class exceptions.StopIt
eration at 0x009B4540>, 'globals': <built-in function globals>, 
'divmod': <built-in function divmod>
, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 
'LookupError': <class excepti
ons.LookupError at 0x009B4BA0>, 'open': <type 'file'>, 'quit': Type 
quit() to exit., 'basestring': <
type 'basestring'>, 'UnicodeError': <class exceptions.UnicodeError at 
0x009B4E40>, 'zip': <built-in
function zip>, 'ipsystem': <function newFunc at 0x011D2270>, 'hex': 
<built-in function hex>, 'long':
  <type 'long'>, 'ReferenceError': <class exceptions.ReferenceError at 
0x009C70C0>, 'ImportError': <c
lass exceptions.ImportError at 0x009B4690>, 'chr': <built-in function 
chr>, 'ip_set_hook': <bound me
thod InteractiveShell.set_hook of <IPython.iplib.InteractiveShell object 
at 0x00A22BB0>>, 'xrange':
<type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, 
exceptions, and other object
s.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in 
slices.", 'Exception': <cla
ss exceptions.Exception at 0x009B4510>, '__IPYTHON__': 
<IPython.iplib.InteractiveShell object at 0x0
0A22BB0>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <class 
exceptions.UnicodeTranslateError
at 0x009C7060>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': 
<class exceptions.UnicodeEncode
Error at 0x009B4ED0>, 'IOError': <class exceptions.IOError at 
0x009B4720>, 'hasattr': <built-in func
tion hasattr>, 'delattr': <built-in function delattr>, 'jobs': 
<IPython.background_jobs.BackgroundJo
bManager instance at 0x00A30508>, 'setattr': <built-in function 
setattr>, 'raw_input': <built-in fun
ction raw_input>, 'SyntaxWarning': <class exceptions.SyntaxWarning at 
0x009C7270>, 'compile': <built
-in function compile>, 'ArithmeticError': <class 
exceptions.ArithmeticError at 0x009B4C60>, 'str': <
type 'str'>, 'property': <type 'property'>, 'dreload': <function reload 
at 0x013012F0>, 'MemoryError
': <class exceptions.MemoryError at 0x009C7120>, 'int': <type 'int'>, 
'__import__': <built-in functi
on __import__>, 'KeyError': <class exceptions.KeyError at 0x009B4C30>, 
'coerce': <built-in function
coerce>, 'PendingDeprecationWarning': <class 
exceptions.PendingDeprecationWarning at 0x009C7240>, 'f
ile': <type 'file'>, 'EnvironmentError': <class 
exceptions.EnvironmentError at 0x009B46C0>, 'unichr'
: <built-in function unichr>, '_ip': <IPython.ipapi.IPApi instance at 
0x012F4B70>, 'id': <built-in f
unction id>, 'OSError': <class exceptions.OSError at 0x009B4780>, 
'DeprecationWarning': <class excep
tions.DeprecationWarning at 0x009C71E0>, 'min': <built-in function min>, 
'execfile': <built-in funct
ion execfile>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 
'ValueError': <class exceptions.V
alueError at 0x009B4DE0>, 'NotImplemented': NotImplemented, 'map': 
<built-in function map>, 'buffer'
: <type 'buffer'>, 'max': <built-in function max>, 'object': <type 
'object'>, 'TabError': <class exc
eptions.TabError at 0x009B4B10>, 'callable': <built-in function 
callable>, 'ZeroDivisionError': <cla
ss exceptions.ZeroDivisionError at 0x009B4CF0>, 'eval': <built-in 
function eval>, '__debug__': True,
  'IndentationError': <class exceptions.IndentationError at 0x009B4AE0>, 
'AssertionError': <class exc
eptions.AssertionError at 0x009B4B70>, 'classmethod': <type 
'classmethod'>, 'UnboundLocalError': <cl
ass exceptions.UnboundLocalError at 0x009B4990>, 'NotImplementedError': 
<class exceptions.NotImpleme
ntedError at 0x009B48A0>, 'AttributeError': <class 
exceptions.AttributeError at 0x009B4A20>, 'Overfl
owError': <class exceptions.OverflowError at 0x009B4C90>, 
'WindowsError': <class exceptions.WindowsE
rror at 0x009B47B0>}, 'debugx': <function debugx at 0x00B7E170>, 'bq': 
<function getoutput at 0x00C6
E6B0>, '__name__': 'IPython.genutils', 'read_dict': <function read_dict 
at 0x00C6E8B0>, 'list2dict':
  <function list2dict at 0x011CA4B0>, 'uniq_stable': <function 
uniq_stable at 0x011CA330>, 'commands'
: <module 'commands' from 'C:\Python24\lib\commands.pyc'>, 'indent': 
<function indent at 0x011CA0B0>
, 'popkey': <function popkey at 0x011CA7B0>, 'timings': <function 
timings at 0x00C579F0>, 'chop': <f
unction chop at 0x011CA5B0>, 'doctest': <module 'doctest' from 
'C:\Python24\lib\doctest.pyc'>, 'get_
home_dir': <function get_home_dir at 0x00C6E9B0>, 'esc_re': 
<_sre.SRE_Pattern object at 0x00BA5F20>,
  'os': <module 'os' from 'C:\Python24\lib\os.pyc'>, 'import_fail_info': 
<function import_fail_info a
t 0x011CA770>, 'SList': <class 'IPython.genutils.SList'>, 'filefind': 
<function filefind at 0x00C6E4
70>, 'get_pager_cmd': <function get_pager_cmd at 0x011CA130>, 
'all_belong': <function all_belong at
0x011CA370>, 'path': <class 'path.path'>, 'IPython': <module 'IPython' 
from 'c:\python\external\ipyt
hon\IPython\__init__.pyc'>, 'mkdict': <function mkdict at 0x011CA470>, 
'SystemExec': <class IPython.
genutils.SystemExec at 0x00C544E0>, 'snip_print': <function snip_print 
at 0x011CA2B0>, 'HomeDirError
': <class IPython.genutils.HomeDirError at 0x011C9360>, 'system': 
<function system at 0x00C6E3B0>, '
getoutput': <function getoutput at 0x00C6E6B0>, 'print_slist': <function 
print_slist at 0x00C6EB30>,
  'types': <module 'types' from 'C:\Python24\lib\types.pyc'>, 
'with_obj': <function with_obj at 0x011
CA5F0>, '__doc__': '\nGeneral purpose utilities.\n\nThis is a grab-bag 
of stuff I find useful in mos
t programs I write. Some of\nthese things are also convenient when 
working at the command line.\n\n$
Id: genutils.py 2763 2007-09-14 06:35:44Z fperez $', 'shell': <function 
shell at 0x00C6E4B0>, 'page_
dumb': <function page_dumb at 0x011CA1F0>, 'getoutputerror': <function 
getoutputerror at 0x00C6E570>
, '__author__': 'Fernando Perez <fperez at colorado.edu>', 'warn': 
<function warn at 0x00B77CB0>, 'ask_
yes_no': <function ask_yes_no at 0x00C6EDB0>, 'qwflat': <function qwflat 
at 0x00C6EEB0>, 'Itpl': <cl
ass IPython.Itpl.Itpl at 0x00B42A80>, 'file_readlines': <function 
file_readlines at 0x00C6E730>, 'gr
ep': <function grep at 0x00C6EF70>, 'raw_input_multi': <function 
raw_input_multi at 0x00C6ED30>, 'er
ror': <function error at 0x00B7E0F0>, 'sort_compare': <function 
sort_compare at 0x011CA430>, 'optstr
2types': <function optstr2types at 0x00C6E870>, 'EvalString': <class 
IPython.genutils.EvalDict at 0x
011C9E70>, 'NLprinter': <class IPython.genutils.NLprinter at 
0x011C9ED0>, 'flag_calls': <function fl
ag_calls at 0x00C6E8F0>, 'dhook_wrap': <function dhook_wrap at 
0x00C6E930>, '__main__': <module '__m
ain__' from 'c:\python24\scripts\ipython.py'>, 'shutil': <module 
'shutil' from 'C:\Python24\lib\shut
il.pyc'>, '__license__': 'BSD', 'belong': <function belong at 
0x011CA2F0>, 'abbrev_cwd': <function a
bbrev_cwd at 0x00C6E330>, 'get_slice': <function get_slice at 
0x011CA570>, 'get_pager_start': <funct
ion get_pager_start at 0x011CA170>, 'file_read': <function file_read at 
0x00C6E7B0>, 'nlprint': <IPy
thon.genutils.NLprinter instance at 0x011DDE40>, 'warnings': <module 
'warnings' from 'C:\Python24\li
b\warnings.pyc'>, 'timings_out': <function timings_out at 0x00C57AF0>, 
'sys': <module 'sys' (built-i
n)>, 'readline': <module 'IPython.rlineimpl' from 
'c:\python\external\ipython\IPython\rlineimpl.pyc'
 >, 'xsys': <function system at 0x00C6E3B0>, 'shell_ori': <function 
shell at 0x00C6E430>, 'get_py_fil
ename': <function get_py_filename at 0x00C6E3F0>, 'print_lsstring': 
<function print_lsstring at 0x00
C6E9F0>, 'time': <module 'time' (built-in)>, 'target_outdated': 
<function target_outdated at 0x00C6E
770>, 'wrap_deprecated': <function wrap_deprecated at 0x011CA7F0>, 
'raw_input_ext': <function raw_in
put_ext at 0x00C6ED70>, 'itpl': <function itpl at 0x00B477F0>}
         loc = {'raw': '', 'tail': '', 's': u'cd \xe5\xe4\xf6', 
'tailpadding': '', 'quote': '"'}
     202             else: app(chunk)
     203         out = ''.join(result)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 
3-5: ordinal not in range(128)


In [2]:



More information about the IPython-dev mailing list