Mercurial 4.2 extension import issue

Augie Fackler lists at durin42.com
Sat Jul 29 00:54:28 UTC 2017


On Fri, Jul 28, 2017 at 10:39 AM, Sébastien Pierre
<sebastien.pierre at gmail.com> wrote:
> Hi there,
>
> I'm running Mercurial 4.2 with Fedora 26 and ran into the following issue.
> Assuming you have the `urwid` python module installed, do the following:

Sounds like https://bz.mercurial-scm.org/show_bug.cgi?id=5617 - could
you try 4.3-rc and see if it fixes your issue?

>
> echo "import urwid;a=urwid.widget" > ~/hgfail.py
>
> and then add
>
> [extensions]
> fail = ~/hgfail.py
>
> then do `hg --version` and then I get this
>
> *** failed to import extension fail from ~/hgfail.py: cannot import name
> command_map
>
> I've asked coworkers to test this and this works with older versions of
> Mercurial. The full backtrace hints at a potential bug with mercurial's
> custom import functions:
>
> *** failed to import extension fail from ~/hgfail.py: cannot import name
> command_map
> Traceback (most recent call last):
>   File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line
> 173, in loadall
>     load(ui, name, path)
>   File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line
> 131, in load
>     mod = _importext(name, path, bind(_reportimporterror, ui))
>   File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line
> 93, in _importext
>     mod = loadpath(path, 'hgext.%s' % name)
>   File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line
> 74, in loadpath
>     return imp.load_source(module_name, path)
>   File "/home/sebastien/hgfail.py", line 1, in <module>
>     import urwid;a=urwid.widget
>   File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line
> 152, in __getattribute__
>     self._load()
>   File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line
> 100, in _load
>     mod = _hgextimport(_import, head, globals, locals, None, level)
>   File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line
> 53, in _hgextimport
>     return importfunc(name, globals, *args, **kwargs)
>   File
> "/home/sebastien/.local/lib/python2.7/site-packages/urwid/__init__.py", line
> 55, in <module>
>     from urwid.main_loop import (ExitMainLoop, MainLoop, SelectEventLoop,
>   File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line
> 260, in _demandimport
>     mod = _hgextimport(_origimport, name, globals, locals)
>   File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line
> 53, in _hgextimport
>     return importfunc(name, globals, *args, **kwargs)
>   File
> "/home/sebastien/.local/lib/python2.7/site-packages/urwid/main_loop.py",
> line 39, in <module>
>     from urwid.command_map import command_map, REDRAW_SCREEN
> ImportError: cannot import name command_map
>
> Can anyone confirm this problem?
>
> Thanks,
>
> -- Sébastien
>
>
>
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>



More information about the Mercurial mailing list