You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I input n = collections.namedtuple?, the ipython crashed
Except
The ipython works fine
Reproduce
you must have an ubuntu server 16 x64
input ipython3
input import collections
input n = collections.namedtuple?
then the IPython crashed and exited
input ipython2
do the same thing as above, then the ipython2 crashed and exited
Code
My crash code
ipython3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
Type "copyright", "credits" or "license" for more information.
IPython 5.2.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import collections
In [2]: n = collections.namedtuple?
Signature: collections.namedtuple(typename, field_names, verbose=False, rename=False)
Docstring:
Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain tuple
33
>>> x, y = p # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y # fields also accessible by name
33
>>> d = p._asdict() # convert to a dictionary
>>> d['x']
11
>>> Point(**d) # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)
File: /usr/lib/python3.5/collections/__init__.py
Type: function
In [3]: n = collections.namedtuple?
Traceback (most recent call last):
File "/usr/local/bin/ipython3", line 11, in <module>
sys.exit(start_ipython())
File "/usr/local/lib/python3.5/dist-packages/IPython/__init__.py", line 119, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/ipapp.py", line 348, in start
self.shell.mainloop()
File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/interactiveshell.py", line 455, in mainloop
self.interact()
File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/interactiveshell.py", line 438, in interact
code = self.prompt_for_code()
File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/interactiveshell.py", line 343, in prompt_for_code
pre_run=self.pre_prompt, reset_current_buffer=True)
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/interface.py", line 408, in run
self._pre_run(pre_run)
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/interface.py", line 383, in _pre_run
pre_run()
File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/interactiveshell.py", line 425, in pre_prompt
self.pt_cli.application.buffer.text = cast_unicode_py2(self.rl_next_input)
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/buffer.py", line 371, in text
assert self.cursor_position <= len(value)
AssertionError
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
Environment
Ubuntu Server
Linux VM-54-125-ubuntu 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ipython3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
Type "copyright", "credits" or "license" for more information.
IPython 5.2.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
ipython2
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
Type "copyright", "credits" or "license" for more information.
IPython 5.2.2 -- An enhanced Interactive Python.
The text was updated successfully, but these errors were encountered:
Description
Actual
When I input
n = collections.namedtuple?
, the ipython crashedExcept
The ipython works fine
Reproduce
ipython3
import collections
n = collections.namedtuple?
ipython2
ipython2
crashed and exitedCode
Environment
The text was updated successfully, but these errors were encountered: