Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython crashes on import of nonexistent module #10629

Closed
staticfloat opened this issue Jun 1, 2017 · 4 comments
Closed

ipython crashes on import of nonexistent module #10629

staticfloat opened this issue Jun 1, 2017 · 4 comments
Milestone

Comments

@staticfloat
Copy link

On OSX, if I attempt to import a nonexistent module, ipython crashes within _get_terminal_size.py:

$ ipython
Python 2.7.13 (default, Apr  4 2017, 08:47:57)
Type "copyright", "credits" or "license" for more information.

IPython 5.4.0 -- 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 not_a_real_module
Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/usr/local/lib/python2.7/site-packages/IPython/__init__.py", line 119, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/sabae/Library/Python/2.7/lib/python/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 355, in start
    self.shell.mainloop()
  File "/usr/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 493, in mainloop
    self.interact()
  File "/usr/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 484, in interact
    self.run_cell(code, store_history=True)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2718, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2847, in run_ast_nodes
    self.showtraceback()
  File "/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 1826, in showtraceback
    value, tb, tb_offset=tb_offset)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1412, in structured_traceback
    self, etype, value, tb, tb_offset, number_of_lines_of_context)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1320, in structured_traceback
    self, etype, value, tb, tb_offset, number_of_lines_of_context
  File "/usr/local/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1170, in structured_traceback
    tb_offset)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1107, in format_exception_as_a_whole
    head = self.prepare_header(etype, self.long_header)
  File "/usr/local/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1041, in prepare_header
    width = min(75, get_terminal_size()[0])
  File "/usr/local/lib/python2.7/site-packages/IPython/utils/terminal.py", line 125, in get_terminal_size
    return _get_terminal_size((defaultx, defaulty))
  File "/usr/local/lib/python2.7/site-packages/IPython/utils/_get_terminal_size.py", line 80, in _get_terminal_size
    res = fcntl.ioctl(fd, termios.TIOCGWINSZ, b"\x00" * 4)
TypeError: argument must be an int, or have a fileno() method.

The error message goes on to tell me to try setting %config Application.verbose_crash=True, but that doesn't improve matters at all.

Carreau added a commit that referenced this issue Jun 1, 2017
@Carreau
Copy link
Member

Carreau commented Jun 1, 2017

Oups, Sight, We bundled get_terminal_size as namespace packages where missing/an issue, and I have an extra underscore somewhere. Fix comming.

@Carreau
Copy link
Member

Carreau commented Jun 1, 2017

Can you try re-updateing ?

@Carreau
Copy link
Member

Carreau commented Jun 1, 2017

I just released 5.4.1 on PyPI.

@Carreau Carreau added this to the 5.4 milestone Jun 1, 2017
@staticfloat
Copy link
Author

Confirmed fixed on 5.4.1. Thanks for the incredibly fast fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants