ipdb icon indicating copy to clipboard operation
ipdb copied to clipboard

TypeError from traitlets when importing ipdb

Open keyan opened this issue 7 years ago • 2 comments

Recently started getting this error when attempting to import ipdb in my tests:

/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/ipdb/__init__.py:7: in <module>
    from ipdb.__main__ import set_trace, post_mortem, pm, run, runcall, runeval, launch_ipdb_on_exception
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/ipdb/__main__.py:47: in <module>
    ipapp.initialize([])
<decorator-gen-112>:2: in initialize
    ???
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/traitlets/config/application.py:87: in catch_config_error
    return method(app, *args, **kwargs)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/terminal/ipapp.py:317: in initialize
    self.init_shell()
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/terminal/ipapp.py:333: in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/traitlets/config/configurable.py:412: in instance
    inst = cls(*args, **kwargs)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py:433: in __init__
    super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/core/interactiveshell.py:653: in __init__
    self.init_history()
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/core/interactiveshell.py:1774: in init_history
    self.history_manager = HistoryManager(shell=self, parent=self)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/IPython/core/history.py:550: in __init__
    self.save_thread = HistorySavingThread(self)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/traitlets/traitlets.py:585: in __set__
    self.set(obj, value)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/traitlets/traitlets.py:559: in set
    new_value = self._validate(obj, value)
/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/traitlets/traitlets.py:591: in _validate
    value = self.validate(obj, value)

Python version 3.6 ipython==7.0.1 traitlets==4.3.2 ipdb==0.11 (also tried ipdb-0.11.1.dev0/0.10.3/others)

I am using the default IPython configuration.

I tried installing various combinations of versions for all these packages including the current master as well with no luck. Also tried modifying the validate() function in traitlets but that just caused other issues understandably.

Apologies if this isn't the correct project to be filing a bug with. Mostly looking for advice on how to debug this. Trying to follow the stacktrace is difficult and there is a lot of IPython specific initialization happening that I'd appreciate some guidance with.

keyan avatar Nov 14 '18 21:11 keyan

When you say recently, does that mean that it does not happen with previous versions of traitlets ? or IPython ?

gotcha avatar Nov 27 '18 21:11 gotcha

Hi! Thanks for following up, appreciate your work on this great tool!

When you say recently, does that mean that it does not happen with previous versions of traitlets ? or IPython ?

I've tried downgrading traitlets and iPython without any luck. When I say "recently", I mean that I just started getting this error. This is all within a particular managed development environment.

Since opening this ticket I've realized I only get this error when using pytest, I cannot reproduce when running tests with unittest. Also not having this issue running in some other project environments.

Pytest version: pytest==3.0.0 (also tried up to latest 4.0.1)

--

I realize this is a very environment specific dependency issue, so likely not much you can do to help. Mostly looking for any pointers if you have ideas for where to dig. Going down the stacktrace hasn't been helpful thus far. Feel free to close this is you don't think it is a larger issue.

Thanks again!

keyan avatar Nov 27 '18 21:11 keyan