dreload kills ipython when it hits zmq #2721

Closed
keflavich opened this Issue Dec 25, 2012 · 2 comments

Comments

Projects
None yet
2 participants

If I try to dreload anything, it eventually hits zmq and drops me out of ipython:

Reloading zmq.core.zmq
ERROR: AttributeError: 'builtin_function_or_method' object has no attribute '__all__' [zmq.core]
Custom TB Handler failed, unregistering
Traceback (most recent call last):
  File "/Users/adam/virtual-python/bin/ipython", line 7, in <module>
    launch_new_instance()
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 389, in launch_new_instance
    app.start()
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 363, in start
    self.shell.mainloop()
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py", line 468, in mainloop
    self.interact(display_banner=display_banner)
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.py", line 587, in interact
    self.run_cell(source_raw, store_history=True)
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2625, in run_cell
    interactivity=interactivity)
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2746, in run_ast_nodes
    self.showtraceback()
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 1747, in showtraceback
    value, tb, tb_offset=tb_offset)
  File "/Users/adam/virtual-python/lib/python2.7/site-packages/IPython/core/ultratb.py", line 1173, in structured_traceback
    self, etype, value, tb, tb_offset, context)
TypeError: unbound method structured_traceback() must be called with FormattedTB instance as first argument (got AutoFormattedTB instance instead)

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:
    c.Application.verbose_crash=True

(this occurs with the latest - i.e. Dec 25 2012 - dev version)

minrk added a commit to minrk/pyzmq that referenced this issue Dec 26, 2012

avoid degenerate name at zmq.core.device
zmq.core.device ends up pointing to zmq.core.device.device,
which causes some confusion in tools like reload.

repro:  `reload(zmq.core)`

Solution: rename *module* `zmq.core._device`, so the name is not degenerate, and zmq.core.device always refers to the function.

See ipython/ipython#2721

@minrk minrk referenced this issue in zeromq/pyzmq Dec 26, 2012

Merged

avoid degenerate name at zmq.core.device #284

Owner

minrk commented Dec 26, 2012

It's pyzmq that's at fault - zmq.core.device is a module on first run, but it's a function after that, so the second time zmq.core.__init__ runs (which can only happen on reload), it's making a mistake. zeromq/pyzmq#284 should fix the issue.

Owner

minrk commented Jan 19, 2013

closing this, as it's not IPython's fault, and is fixed in pyzmq master. You can pass zmq to the exclusions list as a workaround.

@minrk minrk closed this Jan 19, 2013

@minrk minrk added this to the no action milestone Mar 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment