[Attn: mercurial maintainer] hg fails with python3.9

Ken Brown kbrown@cornell.edu
Thu Apr 28 14:27:17 GMT 2022


/usr/bin/hg specifies /usr/bin/python3 in its shebang, but further down it has

   libdir = '../lib/python3.8/site-packages'

This causes hg to fail as follows if /usr/bin/python3 points to python3.9:

$ hg
Traceback (most recent call last):
   File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 69, in 
_importfrom
     fakelocals[modname] = mod = getattr(pkg, modname)
   File "/usr/lib/python3.8/site-packages/mercurial/pycompat.py", line 317, in w
     return f(object, sysstr(name), *args)
AttributeError: module 'mercurial.cext' has no attribute 'parsers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "/usr/bin/hg", line 61, in <module>
     dispatch.run()
   File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
     self.__spec__.loader.exec_module(self)
   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
   File "/usr/lib/python3.8/site-packages/mercurial/dispatch.py", line 21, in 
<module>
     from .i18n import _
   File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
     self.__spec__.loader.exec_module(self)
   File "/usr/lib/python3.8/site-packages/mercurial/i18n.py", line 123, in <module>
     if _plain():
   File "/usr/lib/python3.8/site-packages/mercurial/i18n.py", line 115, in _plain
     b'HGPLAIN' not in encoding.environ
   File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
     self.__spec__.loader.exec_module(self)
   File "/usr/lib/python3.8/site-packages/mercurial/encoding.py", line 41, in 
<module>
     charencode = policy.importmod('charencode')
   File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 116, in 
importmod
     mod = _importfrom(pn, mn)
   File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 71, in 
_importfrom
     raise ImportError('cannot import name %s' % modname)
ImportError: cannot import name parsers

Ken


More information about the Cygwin mailing list