*************************************************************************** IPython post-mortem report IPython version: 0.6.3 Platform info : os.name -> posix, sys.platform -> cygwin *************************************************************************** Current user configuration structure: {'Version': 0, 'alias': [], 'args': [], 'autocall': 1, 'autoindent': 1, 'automagic': 1, 'banner': 1, 'c': '', 'cache_size': 1000, 'classic': 0, 'color_info': 1, 'colors': 'Linux', 'confirm_exit': 1, 'debug': 0, 'deep_reload': 0, 'editor': 'vi', 'execfile': [], 'execute': [], 'gthread': 0, 'help': 0, 'ignore': 0, 'import_all': [], 'import_mod': [], 'import_some': [[]], 'include': [], 'ipythondir': '/home/Administrator/.ipython', 'log': 0, 'logfile': '', 'logplay': '', 'magic_docstrings': 0, 'messages': 1, 'multi_line_specials': 0, 'nosep': 0, 'opts': Struct({}), 'pdb': 0, 'pprint': 1, 'profile': '', 'prompt_in1': 'In [\\#]:', 'prompt_in2': ' .\\D.:', 'prompt_out': 'Out[\\#]:', 'pylab': 0, 'quick': 0, 'rcfile': 'ipythonrc', 'readline': 1, 'readline_omit__names': 0, 'readline_parse_and_bind': ['tab: complete', '"\\C-l": possible-completions', 'set show-all-if-ambiguous on', '"\\C-o": tab-insert', '"\\M-i": " "', '"\\M-o": "\\d\\d\\d\\d"', '"\\M-I": "\\d\\d\\d\\d"', '"\\C-r": reverse-search-history', '"\\C-s": forward-search-history', '"\\C-p": history-search-backward', '"\\C-n": history-search-forward'], 'readline_remove_delims': '\'"[]{}-/~', 'screen_length': -2, 'separate_in': '\n', 'separate_out': '', 'separate_out2': '', 'system_verbose': 0, 'upgrade': 0, 'wthread': 0, 'xmode': 'Context'} *************************************************************************** Crash traceback: --------------------------------------------------------------------------- OSError Python 2.3.4: /usr/bin/python2.3 Sun Nov 7 17:33:35 2004 A problem occured executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /usr/bin/ipython -2 import IPython -1 0 IPython.Shell.start().mainloop() /usr/lib/python2.3/site-packages/IPython/Shell.py in mainloop(self=, sys_exit=0) 44 45 #----------------------------------------------------------------------------- 46 # This class is trivial now, but I want to have it in to publish a clean 47 # interface. Later when the internals are reorganized, code that uses this 48 # shouldn't have to change. 49 50 class IPShell: 51 """Create an IPython instance.""" 52 53 def __init__(self,argv=None,user_ns=None,debug=0, 54 shell_class=InteractiveShell): 55 self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, 56 shell_class=shell_class) 57 58 def mainloop(self,sys_exit=0): ---> 59 self.IP.mainloop() self = , global IP = undefined, global mainloop = undefined 60 if sys_exit: 61 sys.exit() 62 63 #----------------------------------------------------------------------------- 64 class IPShellEmbed: 65 """Allow embedding an IPython shell into a running program. 66 67 Instances of this class are callable, with the __call__ method being an 68 alias to the embed() method of an InteractiveShell instance. 69 70 Usage (see also the example-embed.py file for a running example): 71 72 IPShell = IPythonShellEmbed([argv,banner,exit_msg,rc_override]) 73 74 - argv: list containing valid command-line options for IPython, as they /usr/lib/python2.3/site-packages/IPython/iplib.py in mainloop(self=) 916 917 def name_space_init(self): 918 """Create local namespace.""" 919 # We want this to be a method to facilitate embedded initialization. 920 code.InteractiveConsole.__init__(self,self.user_ns) 921 922 def mainloop(self): 923 """Creates the local namespace and starts the mainloop""" 924 self.name_space_init() 925 if self.rc.c: # Emulate Python's -c option 926 self.exec_init_cmd() 927 if self.rc.banner: 928 banner = self.BANNER+self.banner2 929 else: 930 banner = '' --> 931 self.interact(banner) self = , global interact = undefined, banner = 'Python 2.3.4 (#1, Jun 13 2004, 11:21:03) \nType "...ut \'object\'. ?object also works, ?? prints more.\n' 932 933 def exec_init_cmd(self): 934 """Execute a command given at the command line. 935 936 This emulates Python's -c option.""" 937 938 sys.argv = ['-c'] 939 self.push(self.rc.c) 940 941 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): 942 """Embeds IPython into a running python program. 943 944 Input: 945 946 - header: An optional header message can be specified. /usr/lib/python2.3/site-packages/IPython/iplib.py in interact(self=, banner='Python 2.3.4 (#1, Jun 13 2004, 11:21:03) \nType "...ut \'object\'. ?object also works, ?? prints more.\n') 1128 There seemed to be a problem with your sys.stdout. 1129 """ 1130 1131 if sys.stderr is not sys.__stderr__: 1132 sys.stderr = sys.__stderr__ 1133 fixed_in_out_err = 1 1134 print >> sys.__stderr__,""" 1135 WARNING: 1136 sys.stderr has been reset to sys.__stderr__. 1137 There seemed to be a problem with your sys.stderr. 1138 """ 1139 # If the problem wasn't a broken out/err, it's an IPython bug 1140 # I wish we could ask the user whether to crash or not, but 1141 # calling any function at this point messes up the stack. 1142 if not fixed_in_out_err: -> 1143 raise 1144 1145 # We are off again... 1146 __builtin__.__dict__['__IPYTHON__active'] -= 1 1147 1148 def excepthook(self, type, value, tb): 1149 """One more defense for GUI apps that call sys.excepthook. 1150 1151 GUI frameworks like wxPython trap exceptions and call 1152 sys.excepthook themselves. I guess this is a feature that 1153 enables them to keep running after exceptions that would 1154 otherwise kill their mainloop. This is a bother for IPython 1155 which excepts to catch all of the program exceptions with a try: 1156 except: statement. 1157 1158 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if /usr/lib/python2.3/site-packages/IPython/iplib.py in raw_input(self=, prompt=) 1232 else: 1233 if code.softspace(sys.stdout, 0): 1234 print 1235 1236 def raw_input(self, prompt=""): 1237 """Write a prompt and read a line. 1238 1239 The returned line does not include the trailing newline. 1240 When the user enters the EOF key sequence, EOFError is raised. 1241 1242 The base implementation uses the built-in function 1243 raw_input(); a subclass may replace this with a different 1244 implementation. 1245 """ 1246 return self.prefilter(raw_input(prompt), -> 1247 prompt==self.outputcache.prompt2) prompt = , self = , global outputcache = undefined, global prompt2 = undefined 1248 1249 def split_user_input(self,line): 1250 """Split user input into pre-char, function part and rest.""" 1251 1252 lsplit = self.line_split.match(line) 1253 if lsplit is None: # no regexp match returns None 1254 line = line.rstrip() 1255 ini_spaces = re.match('^(\s+)',line) 1256 if ini_spaces: 1257 nspaces = ini_spaces.end() 1258 else: 1259 nspaces = 0 1260 1261 pre = ' '*nspaces 1262 try: /usr/lib/python2.3/site-packages/IPython/iplib.py in _prefilter(self=, line='?', continue_prompt=False) 1303 self.outputcache.prompt_count -= 1 1304 return self.handle_normal('',continue_prompt) 1305 1306 # print '***cont',continue_prompt # dbg 1307 # special handlers are only allowed for single line statements 1308 if continue_prompt and not self.rc.multi_line_specials: 1309 return self.handle_normal(line,continue_prompt) 1310 1311 # First check for explicit escapes in the last/first character 1312 handler = None 1313 if line[-1] == self.ESC_HELP: 1314 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end 1315 if handler is None: 1316 handler = self.esc_handlers.get(line[0]) 1317 if handler is not None: -> 1318 return handler(line,continue_prompt) handler = >, line = '?', continue_prompt = False 1319 1320 # Emacs ipython-mode tags certain input lines 1321 if line.endswith('# PYTHON-MODE'): 1322 return self.handle_emacs(line,continue_prompt) 1323 1324 # Next, check if we can automatically execute this thing 1325 pre,iFun,theRest = self.split_user_input(line) 1326 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg 1327 1328 # Allow ! in multi-line statements if multi_line_specials is on: 1329 if continue_prompt and self.rc.multi_line_specials and \ 1330 not pre.strip() and iFun.startswith(self.ESC_SHELL): 1331 return self.handle_shell_escape(line,continue_prompt, 1332 pre=pre,iFun=iFun,theRest=theRest) 1333 /usr/lib/python2.3/site-packages/IPython/iplib.py in handle_help(self=, line='', continue_prompt=False) 1478 # We need to make sure that we don't process lines which would be 1479 # otherwise valid python, such as "x=1 # what?" 1480 try: 1481 code.compile_command(line) 1482 except SyntaxError: 1483 # We should only handle as help stuff which is NOT valid syntax 1484 if line[0]==self.ESC_HELP: 1485 line = line[1:] 1486 elif line[-1]==self.ESC_HELP: 1487 line = line[:-1] 1488 self.log('#?'+line) 1489 self.update_cache(line) 1490 if line: 1491 self.magic_pinfo(line) 1492 else: -> 1493 page(self.usage,screen_lines=self.rc.screen_length) global page = , self = , global usage = undefined, global screen_lines = undefined, global rc = undefined, global screen_length = undefined 1494 return '' # Empty string is needed here! 1495 except: 1496 # Pass any other exceptions through to the normal handler 1497 return self.handle_normal(line,continue_prompt) 1498 else: 1499 # If the code compiles ok, we should handle it normally 1500 return self.handle_normal(line,continue_prompt) 1501 1502 def handle_emacs(self,line,continue_prompt): 1503 """Handle input lines marked by python-mode.""" 1504 1505 # Currently, nothing is done. Later more functionality can be added 1506 # here if needed. 1507 1508 # The input cache shouldn't be updated /usr/lib/python2.3/site-packages/IPython/genutils.py in page(strng="\nIPython -- An enhanced Interactive Python\n=====...2]= ['a', 'b'] # quote explicitly and it works.\n", start=0, screen_lines=23, pager_cmd='less -r ') 1065 else: 1066 try: 1067 retval = None 1068 # if I use popen4, things hang. No idea why. 1069 #pager,shell_out = os.popen4(pager_cmd) 1070 pager = os.popen(pager_cmd,'w') 1071 pager.write(strng) 1072 #shell_out.close() 1073 pager.close() 1074 #retval = None 1075 retval = pager.close() # success returns None 1076 except IOError,msg: # broken pipe when user quits 1077 if msg.args == (32,'Broken pipe'): 1078 retval = None 1079 else: -> 1080 retval = 1 retval = None 1081 if retval is not None: 1082 page_dumb(strng,screen_lines=screen_lines) 1083 1084 #---------------------------------------------------------------------------- 1085 def page_file(fname,start = 0, pager_cmd = None): 1086 """Page a file, using an optional pager command and starting line. 1087 """ 1088 1089 pager_cmd = get_pager_cmd(pager_cmd) 1090 pager_cmd += ' ' + get_pager_start(pager_cmd,start) 1091 1092 try: 1093 if os.environ['TERM'] in ['emacs','dumb']: 1094 raise EnvironmentError 1095 xsys(pager_cmd + ' ' + fname) OSError: [Errno 11] Resource temporarily unavailable *************************************************************************** History of session input: #? *** Last line of input (may not be in above history): ?