ipython/ipython — Issue #965: ipython is crashed without launching.(python3.2)
Author: yyr
Created: 2011-11-02 15:58:40+00:00
State: open

Just installed ipython for python3 and launched. it crashes with the report.

```text
***************************************************************************

IPython post-mortem report

{'commit_hash': '0021257',
'commit_source': 'installation',
'ipython_path': '/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython',
'ipython_version': '0.12.dev',
'os_name': 'posix',
'platform': 'Linux-3.0.0-12-generic-x86_64-with-debian-wheezy-sid',
'sys_executable': '/home/yagnesh/local/python/bin/python3.2',
'sys_platform': 'linux2',
'sys_version': '3.2.2 (default, Nov 2 2011, 02:46:57) \n[GCC 4.6.1]'}

***************************************************************************

***************************************************************************

Crash traceback:

---------------------------------------------------------------------------
AttributeError Python 3.2.2: /home/yagnesh/local/python/bin/python3.2
Thu Nov 3 00:55:58 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.
/home/yagnesh/local/python/bin/ipython3 in ()
1 #!/home/yagnesh/local/python/bin/python3.2
2 # EASY-INSTALL-ENTRY-SCRIPT: 'ipython==0.12.dev','console_scripts','ipython3'
3 __requires__ = 'ipython==0.12.dev'
4 import sys
5 from pkg_resources import load_entry_point
6
7 if __name__ == '__main__':
8 sys.exit(
----> 9 load_entry_point('ipython==0.12.dev', 'console_scripts', 'ipython3')()
global load_entry_point =
10 )

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/frontend/terminal/ipapp.py in launch_new_instance()
377 ipython_dir = get_ipython_dir()
378 profile_dir = os.path.join(ipython_dir, 'profile_default')
379 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
380 try:
381 config = cl.load_config()
382 except ConfigFileNotFound:
383 # no config found
384 config = Config()
385 return config
386
387
388 def launch_new_instance():
389 """Create and run a full blown IPython instance"""
390 app = TerminalIPythonApp.instance()
391 app.initialize()
--> 392 app.start()
app.start = >
393
394
395 if __name__ == '__main__':
396 launch_new_instance()

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/frontend/terminal/ipapp.py in start(self=)
351 "toolkit=%s, pylab=%s" % (gui, self.pylab) )
352 if self.pylab:
353 activate(gui, import_all=self.pylab_import_all)
354 else:
355 activate(gui)
356 except:
357 self.log.warn("Error in enabling GUI event loop integration:")
358 self.shell.showtraceback()
359
360 def start(self):
361 if self.subapp is not None:
362 return self.subapp.start()
363 # perform any prexec steps:
364 if self.interact:
365 self.log.debug("Starting IPython's mainloop...")
--> 366 self.shell.mainloop()
self.shell.mainloop = >
367 else:
368 self.log.debug("IPython not interactive...")
369
370
371 def load_default_config(ipython_dir=None):
372 """Load the default config file from the default ipython_dir.
373
374 This is useful for embedded shells.
375 """
376 if ipython_dir is None:
377 ipython_dir = get_ipython_dir()
378 profile_dir = os.path.join(ipython_dir, 'profile_default')
379 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
380 try:
381 config = cl.load_config()

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/frontend/terminal/interactiveshell.py in mainloop(self=, display_banner=None)
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)
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")
self.write = >
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)
238 stdin_encoding = sys.stdin.encoding or "utf-8"
239 self.readline.add_history(py3compat.unicode_to_str(source_raw.rstrip(),
240 stdin_encoding))
241
242 def interact(self, display_banner=None):
243 """Closely emulate the interactive Python console."""
244
245 # batch run -> do not interact

/home/yagnesh/local/python/lib/python3.2/contextlib.py in __exit__(self=, type=, value=AttributeError("'NoneType' object has no attribute 'get_current_history_length'",), traceback=)
51
52 def __exit__(self, type, value, traceback):
53 if type is None:
54 try:
55 next(self.gen)
56 except StopIteration:
57 return
58 else:
59 raise RuntimeError("generator didn't stop")
60 else:
61 if value is None:
62 # Need to force instantiation so we can reliably
63 # tell if we get the same exception back
64 value = type()
65 try:
---> 66 self.gen.throw(type, value, traceback)
self.gen.throw =
type =
value = AttributeError("'NoneType' object has no attribute 'get_current_history_length'",)
traceback =
67 raise RuntimeError("generator didn't stop after throw()")
68 except StopIteration as exc:
69 # Suppress the exception *unless* it's the same exception that
70 # was passed to throw(). This prevents a StopIteration
71 # raised inside the "with" statement from being suppressed
72 return exc is not value
73 except:
74 # only re-raise if it's *not* the exception that was
75 # passed to throw(), because __exit__() must not raise
76 # an exception unless __exit__() itself failed. But throw()
77 # has to raise the exception to signal propagation, so this
78 # fixes the impedance mismatch between the throw() protocol
79 # and the __exit__() protocol.
80 #
81 if sys.exc_info()[1] is not value:

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/utils/nested_context.py in nested(*managers=(, ))
35 yield vars
36 except:
37 exc = sys.exc_info()
38 finally:
39 while exits:
40 exit = exits.pop()
41 try:
42 if exit(*exc):
43 exc = (None, None, None)
44 except:
45 exc = sys.exc_info()
46 if exc != (None, None, None):
47 # Don't rely on sys.exc_info() still containing
48 # the right information. Another exception may
49 # have been raised and caught by an exit method
---> 50 raise exc[0](exc[1]).with_traceback(exc[2])
exc = (, AttributeError("'NoneType' object has no attribute 'get_current_history_length'",), )
exc.with_traceback = undefined

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/utils/nested_context.py in nested(*managers=(, ))
20 used with a variable number of context managers as follows:
21
22 with nested(*managers):
23 do_something()
24
25 """
26 exits = []
27 vars = []
28 exc = (None, None, None)
29 try:
30 for mgr in managers:
31 exit = mgr.__exit__
32 enter = mgr.__enter__
33 vars.append(enter())
34 exits.append(exit)
---> 35 yield vars
vars = [, ]
36 except:
37 exc = sys.exc_info()
38 finally:
39 while exits:
40 exit = exits.pop()
41 try:
42 if exit(*exc):
43 exc = (None, None, None)
44 except:
45 exc = sys.exc_info()
46 if exc != (None, None, None):
47 # Don't rely on sys.exc_info() still containing
48 # the right information. Another exception may
49 # have been raised and caught by an exit method
50 raise exc[0](exc[1]).with_traceback(exc[2])

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/frontend/terminal/interactiveshell.py in mainloop(self=, 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)
self.interact = >
display_banner = None
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)

/home/yagnesh/local/python/lib/python3.2/site-packages/ipython-0.12.dev-py3.2.egg/IPython/frontend/terminal/interactiveshell.py in interact(self=, 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, str):
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()
hlen_before_cell = undefined
self.readline.get_current_history_length = undefined
259
260 # Mark activity in the builtins
261 builtins.__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):

```