Git Product home page Git Product logo

Comments (5)

krassowski avatar krassowski commented on June 19, 2024

IPython 5.10.0

Can you reproduce this using a modern version of IPython? I suspect it is unlikely that a patch would be backported so far back, the current version is 8.24 and there has been a complete refactor of the completer in 8.x series

from ipython.

cielavenir avatar cielavenir commented on June 19, 2024
  • Python 3.9.19
  • IPython 8.18.1
docker run --rm -it --entrypoint=bash python:3.9

rm /usr/local/lib/python3.*/lib-dynload/_gdbm.cpython*.so
python -m pip install six
python3 -m pip install IPython~=8.0
ipython

shows this, though IPython process does not crash

In [1]: import six.moves.a[TAB]

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 3171, in _complete
    result = matcher(context)
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 2707, in custom_completer_matcher
    matches = self.dispatch_custom_completer(context.token) or []
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 2747, in dispatch_custom_completer
    res = c(event)
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completerlib.py", line 276, in module_completer
    return module_completion(event.line)
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completerlib.py", line 253, in module_completion
    completion_list = try_import('.'.join(mod[:-1]), True)
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completerlib.py", line 186, in try_import
    completions.extend( [attr for attr in dir(m) if
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completerlib.py", line 187, in <listcomp>
    is_importable(m, attr, only_modules)])
  File "/usr/local/lib/python3.9/site-packages/IPython/core/completerlib.py", line 156, in is_importable
    return inspect.ismodule(getattr(module, attr))
  File "/usr/local/lib/python3.9/site-packages/six.py", line 97, in __get__
    result = self._resolve()
  File "/usr/local/lib/python3.9/site-packages/six.py", line 120, in _resolve
    return _import_module(self.mod)
  File "/usr/local/lib/python3.9/site-packages/six.py", line 87, in _import_module
    __import__(name)
  File "/usr/local/lib/python3.9/dbm/gnu.py", line 3, in <module>
    from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'

If you suspect this is an IPython 8.18.1 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

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

from ipython.

krassowski avatar krassowski commented on June 19, 2024

Adding a catch for ModuleNotFoundError around inspect.ismodule call sounds reasonable to me, but then if reproducer involves deleting shared library from file disk I am not sure if this is really a bug or just a problem with the Python installation?

from ipython.

cielavenir avatar cielavenir commented on June 19, 2024

@krassowski gdbm (and tk) are optional packages. Not directly reproducible in python3 docker images but easily reproducible with ubuntu/debian not installing python3-gdbm. (Especially gdbm being GPL)

from ipython.

cielavenir avatar cielavenir commented on June 19, 2024

notifying @felixvd and @hemangandhi as our system does not install python-gdbm

from ipython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.