Skip to content

Instantly share code, notes, and snippets.

@jfeser
Created October 24, 2011 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfeser/1310580 to your computer and use it in GitHub Desktop.
Save jfeser/1310580 to your computer and use it in GitHub Desktop.
ipython crash log return
***************************************************************************
IPython post-mortem report
{'commit_hash': '<not found>',
'commit_source': '(none found)',
'ipython_path': '/usr/lib/python3.2/site-packages/IPython',
'ipython_version': '0.11',
'os_name': 'posix',
'platform': 'Linux-3.0-ARCH-i686-Intel-R-_Core-TM-2_Duo_CPU_P8400_@_2.26GHz-with-glibc2.0',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '3.2.2 (default, Sep 5 2011, 04:33:58) \n[GCC 4.6.1 20110819 (prerelease)]'}
***************************************************************************
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
SyntaxError Python 3.2.2: /usr/bin/python
Mon Oct 24 17:27:51 2011
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 in <module>()
1 #!/usr/bin/python
2 """Terminal-based IPython entry point.
3 """
4
5 from IPython.frontend.terminal.ipapp import launch_new_instance
6
----> 7 launch_new_instance()
global launch_new_instance = <function launch_new_instance at 0x994faac>
/usr/lib/python3.2/site-packages/IPython/frontend/terminal/ipapp.py in launch_new_instance()
355 ipython_dir = get_ipython_dir()
356 profile_dir = os.path.join(ipython_dir, 'profile_default')
357 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
358 try:
359 config = cl.load_config()
360 except IOError:
361 # no config found
362 config = Config()
363 return config
364
365
366 def launch_new_instance():
367 """Create and run a full blown IPython instance"""
368 app = TerminalIPythonApp.instance()
369 app.initialize()
--> 370 app.start()
app.start = <bound method TerminalIPythonApp.start of <IPython.frontend.terminal.ipapp.TerminalIPythonApp object at 0xb70bc7ac>>
371
372
373 if __name__ == '__main__':
374 launch_new_instance()
/usr/lib/python3.2/site-packages/IPython/frontend/terminal/ipapp.py in start(self=<IPython.frontend.terminal.ipapp.TerminalIPythonApp object>)
329 if gui or self.pylab:
330 try:
331 self.log.info("Enabling GUI event loop integration, "
332 "toolkit=%s, pylab=%s" % (gui, self.pylab) )
333 activate(gui)
334 except:
335 self.log.warn("Error in enabling GUI event loop integration:")
336 self.shell.showtraceback()
337
338 def start(self):
339 if self.subapp is not None:
340 return self.subapp.start()
341 # perform any prexec steps:
342 if self.interact:
343 self.log.debug("Starting IPython's mainloop...")
--> 344 self.shell.mainloop()
self.shell.mainloop = <bound method TerminalInteractiveShell.mainloop of <IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object at 0x9956ecc>>
345 else:
346 self.log.debug("IPython not interactive...")
347
348
349 def load_default_config(ipython_dir=None):
350 """Load the default config file from the default ipython_dir.
351
352 This is useful for embedded shells.
353 """
354 if ipython_dir is None:
355 ipython_dir = get_ipython_dir()
356 profile_dir = os.path.join(ipython_dir, 'profile_default')
357 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
358 try:
359 config = cl.load_config()
/usr/lib/python3.2/site-packages/IPython/frontend/terminal/interactiveshell.py in mainloop(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=None)
206 #-------------------------------------------------------------------------
207 # Mainloop and code execution logic
208 #-------------------------------------------------------------------------
209
210 def mainloop(self, display_banner=None):
211 """Start the mainloop.
212
213 If an optional banner argument is given, it will override the
214 internally created default banner.
215 """
216
217 with self.builtin_trap, self.display_trap:
218
219 while 1:
220 try:
--> 221 self.interact(display_banner=display_banner)
self.interact = <bound method TerminalInteractiveShell.interact of <IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object at 0x9956ecc>>
display_banner = None
222 #self.interact_with_readline()
223 # XXX for testing of a readline-decoupled repl loop, call
224 # interact_with_readline above
225 break
226 except KeyboardInterrupt:
227 # this should not be necessary, but KeyboardInterrupt
228 # handling seems rather unpredictable...
229 self.write("\nKeyboardInterrupt in interact()\n")
230
231 def interact(self, display_banner=None):
232 """Closely emulate the interactive Python console."""
233
234 # batch run -> do not interact
235 if self.exit_now:
236 return
/usr/lib/python3.2/site-packages/IPython/frontend/terminal/interactiveshell.py in interact(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=False)
296 'Because of how pdb handles the stack, it is impossible\n'
297 'for IPython to properly format this particular exception.\n'
298 'IPython will resume normal operation.')
299 except:
300 # exceptions here are VERY RARE, but they can be triggered
301 # asynchronously by signal handlers, for example.
302 self.showtraceback()
303 else:
304 self.input_splitter.push(line)
305 more = self.input_splitter.push_accepts_more()
306 if (self.SyntaxTB.last_syntax_error and
307 self.autoedit_syntax):
308 self.edit_syntax_error()
309 if not more:
310 source_raw = self.input_splitter.source_raw_reset()[1]
--> 311 self.run_cell(source_raw)
self.run_cell = <bound method TerminalInteractiveShell.run_cell of <IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object at 0x9956ecc>>
source_raw = 'return\n'
312
313 # We are off again...
314 builtins.__dict__['__IPYTHON__active'] -= 1
315
316 # Turn off the exit flag, so the mainloop can be restarted if desired
317 self.exit_now = False
318
319 def raw_input(self, prompt=''):
320 """Write a prompt and read a line.
321
322 The returned line does not include the trailing newline.
323 When the user enters the EOF key sequence, EOFError is raised.
324
325 Optional inputs:
326
/usr/lib/python3.2/site-packages/IPython/core/interactiveshell.py in run_cell(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, raw_cell='return\n', store_history=True)
2252
2253 with self.display_trap:
2254 try:
2255 code_ast = ast.parse(cell, filename=cell_name)
2256 except IndentationError:
2257 self.showindentationerror()
2258 self.execution_count += 1
2259 return None
2260 except (OverflowError, SyntaxError, ValueError, TypeError,
2261 MemoryError):
2262 self.showsyntaxerror()
2263 self.execution_count += 1
2264 return None
2265
2266 self.run_ast_nodes(code_ast.body, cell_name,
-> 2267 interactivity="last_expr")
global interactivity = undefined
2268
2269 # Execute any registered post-execution functions.
2270 for func, status in self._post_execute.items():
2271 if not status:
2272 continue
2273 try:
2274 func()
2275 except:
2276 self.showtraceback()
2277 # Deactivate failing function
2278 self._post_execute[func] = False
2279
2280 if store_history:
2281 # Write output to the database. Does nothing unless
2282 # history output logging is enabled.
/usr/lib/python3.2/site-packages/IPython/core/interactiveshell.py in run_ast_nodes(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, nodelist=[<_ast.Return object>], cell_name='<ipython-input-1-64672a10de46>', interactivity='none')
2312 interactivity = "none"
2313
2314 if interactivity == 'none':
2315 to_run_exec, to_run_interactive = nodelist, []
2316 elif interactivity == 'last':
2317 to_run_exec, to_run_interactive = nodelist[:-1], nodelist[-1:]
2318 elif interactivity == 'all':
2319 to_run_exec, to_run_interactive = [], nodelist
2320 else:
2321 raise ValueError("Interactivity was %r" % interactivity)
2322
2323 exec_count = self.execution_count
2324
2325 for i, node in enumerate(to_run_exec):
2326 mod = ast.Module([node])
-> 2327 code = self.compile(mod, cell_name, "exec")
code = undefined
self.compile = <IPython.core.compilerop.CachingCompiler object at 0x9956eec>
mod = <_ast.Module object at 0x9b16d0c>
cell_name = '<ipython-input-1-64672a10de46>'
2328 if self.run_code(code):
2329 return True
2330
2331 for i, node in enumerate(to_run_interactive):
2332 mod = ast.Interactive([node])
2333 code = self.compile(mod, cell_name, "single")
2334 if self.run_code(code):
2335 return True
2336
2337 return False
2338
2339 def run_code(self, code_obj):
2340 """Execute a code object.
2341
2342 When an exception occurs, self.showtraceback() is called to display a
/usr/lib/python3.2/codeop.py in __call__(self=<IPython.core.compilerop.CachingCompiler object>, source=<_ast.Module object>, filename='<ipython-input-1-64672a10de46>', symbol='exec')
118 - Raise SyntaxError, ValueError or OverflowError if the command is a
119 syntax error (OverflowError and ValueError can be produced by
120 malformed literals).
121 """
122 return _maybe_compile(_compile, source, filename, symbol)
123
124 class Compile:
125 """Instances of this class behave much like the built-in compile
126 function, but if one is used to compile text containing a future
127 statement, it "remembers" and compiles all subsequent program texts
128 with the statement in force."""
129 def __init__(self):
130 self.flags = PyCF_DONT_IMPLY_DEDENT
131
132 def __call__(self, source, filename, symbol):
--> 133 codeob = compile(source, filename, symbol, self.flags, 1)
codeob = undefined
global compile = undefined
source = <_ast.Module object at 0x9b16d0c>
filename = '<ipython-input-1-64672a10de46>'
symbol = 'exec'
self.flags = 512
134 for feature in _features:
135 if codeob.co_flags & feature.compiler_flag:
136 self.flags |= feature.compiler_flag
137 return codeob
138
139 class CommandCompiler:
140 """Instances of this class have __call__ methods identical in
141 signature to compile_command; the difference is that if the
142 instance compiles program text containing a __future__ statement,
143 the instance 'remembers' and compiles all subsequent program texts
144 with the statement in force."""
145
146 def __init__(self,):
147 self.compiler = Compile()
148
SyntaxError: 'return' outside function (<ipython-input-1-64672a10de46>, line 1)
***************************************************************************
History of session input:return
*** Last line of input (may not be in above history):
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment