Skip to content

Instantly share code, notes, and snippets.

@jstenar
Created October 20, 2011 19:16
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 jstenar/1302023 to your computer and use it in GitHub Desktop.
Save jstenar/1302023 to your computer and use it in GitHub Desktop.
ipython crash dump readline missing
***************************************************************************
IPython post-mortem report
{'commit_hash': 'bae849b',
'commit_source': 'repository',
'ipython_path': 'c:\\python\\external\\ipython\\IPython',
'ipython_version': '0.12.dev',
'os_name': 'nt',
'platform': 'Windows-7-6.1.7601-SP1',
'sys_executable': 'c:\\python26\\python.exe',
'sys_platform': 'win32',
'sys_version': '2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]'}
***************************************************************************
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
AttributeError Python 2.6.6: c:\python26\python.exe
Thu Oct 20 21:12:43 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.
C:\python\ipydevel\<string> in <module>()
c:\python\external\ipython\IPython\frontend\terminal\ipapp.pyc in launch_new_instance()
365 self.shell.mainloop()
366 else:
367 self.log.debug("IPython not interactive...")
368
369
370 def load_default_config(ipython_dir=None):
371 """Load the default config file from the default ipython_dir.
372
373 This is useful for embedded shells.
374 """
375 if ipython_dir is None:
376 ipython_dir = get_ipython_dir()
377 profile_dir = os.path.join(ipython_dir, 'profile_default')
378 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
379 try:
380 config = cl.load_config()
381 except ConfigFileNotFound:
382 # no config found
383 config = Config()
384 return config
385
386
387 def launch_new_instance():
388 """Create and run a full blown IPython instance"""
389 app = TerminalIPythonApp.instance()
390 app.initialize()
--> 391 app.start()
392
393
394 if __name__ == '__main__':
395 launch_new_instance()
c:\python\external\ipython\IPython\frontend\terminal\ipapp.pyc in start(self=<IPython.frontend.terminal.ipapp.TerminalIPythonApp object>)
350 "toolkit=%s, pylab=%s" % (gui, self.pylab) )
351 if self.pylab:
352 activate(gui, import_all=self.pylab_import_all)
353 else:
354 activate(gui)
355 except:
356 self.log.warn("Error in enabling GUI event loop integration:")
357 self.shell.showtraceback()
358
359 def start(self):
360 if self.subapp is not None:
361 return self.subapp.start()
362 # perform any prexec steps:
363 if self.interact:
364 self.log.debug("Starting IPython's mainloop...")
--> 365 self.shell.mainloop()
366 else:
367 self.log.debug("IPython not interactive...")
368
369
370 def load_default_config(ipython_dir=None):
371 """Load the default config file from the default ipython_dir.
372
373 This is useful for embedded shells.
374 """
375 if ipython_dir is None:
376 ipython_dir = get_ipython_dir()
377 profile_dir = os.path.join(ipython_dir, 'profile_default')
378 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
379 try:
380 config = cl.load_config()
c:\python\external\ipython\IPython\frontend\terminal\interactiveshell.pyc in mainloop(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=None)
207 #-------------------------------------------------------------------------
208 # Mainloop and code execution logic
209 #-------------------------------------------------------------------------
210
211 def mainloop(self, display_banner=None):
212 """Start the mainloop.
213
214 If an optional banner argument is given, it will override the
215 internally created default banner.
216 """
217
218 with nested(self.builtin_trap, self.display_trap):
219
220 while 1:
221 try:
--> 222 self.interact(display_banner=display_banner)
global a = undefined
223 #self.interact_with_readline()
224 # XXX for testing of a readline-decoupled repl loop, call
225 # interact_with_readline above
226 break
227 except KeyboardInterrupt:
228 # this should not be necessary, but KeyboardInterrupt
229 # handling seems rather unpredictable...
230 self.write("\nKeyboardInterrupt in interact()\n")
231
232 def _replace_rlhist_multiline(self, source_raw, hlen_before_cell):
233 """Store multiple lines as a single entry in history"""
234 if self.multiline_history and self.has_readline:
235 hlen = self.readline.get_current_history_length()
236 for i in range(hlen - hlen_before_cell):
237 self.readline.remove_history_item(hlen - i - 1)
c:\python\external\ipython\IPython\frontend\terminal\interactiveshell.pyc in interact(self=<IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=False)
243 """Closely emulate the interactive Python console."""
244
245 # batch run -> do not interact
246 if self.exit_now:
247 return
248
249 if display_banner is None:
250 display_banner = self.display_banner
251
252 if isinstance(display_banner, basestring):
253 self.show_banner(display_banner)
254 elif display_banner:
255 self.show_banner()
256
257 more = False
--> 258 hlen_before_cell = self.readline.get_current_history_length()
global cpaste = undefined
global manually = undefined
global paste = undefined
global code = undefined
global into = undefined
global terminal = undefined
global until = undefined
global you = undefined
global mark = undefined
global its = undefined
global end. = undefined
259
260 # Mark activity in the builtins
261 __builtin__.__dict__['__IPYTHON__active'] += 1
262
263 if self.has_readline:
264 self.readline_startup_hook(self.pre_readline)
265 # exit_now is set by a call to %Exit or %Quit, through the
266 # ask_exit callback.
267
268 while not self.exit_now:
269 self.hooks.pre_prompt_hook()
270 if more:
271 try:
272 prompt = self.hooks.generate_prompt(True)
273 except:
AttributeError: 'NoneType' object has no attribute 'get_current_history_length'
***************************************************************************
History of session input:
*** Last line of input (may not be in above history):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment