[issue453] hg commit fails because of unavailable package import

Patrick Mézard mercurial-bugs at selenic.com
Sun Dec 17 07:32:56 CST 2006


New submission from Patrick Mézard <pmezard at gmail.com>:

hg commit fails with crew:
"""
>hg commit
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version b12eae71382d)
Traceback (most recent call last):
  File "d:\python25\scripts\hg", line 11, in <module>
    mercurial.commands.run()
  File "D:\Python25\Lib\site-packages\mercurial\commands.py", line 2964, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "D:\Python25\Lib\site-packages\mercurial\commands.py", line 3187, in dispatch
    return d()
  File "D:\Python25\Lib\site-packages\mercurial\commands.py", line 3146, in <lambda>
    d = lambda: func(u, repo, *args, **cmdoptions)
  File "D:\Python25\Lib\site-packages\mercurial\commands.py", line 453, in commit
    force_editor=opts.get('force_editor'))
  File "D:\Python25\Lib\site-packages\hgext\mq.py", line 2018, in commit
    return super(mqrepo, self).commit(*args, **opts)
  File "D:\Python25\Lib\site-packages\mercurial\localrepo.py", line 757, in commit
    text = self.ui.edit("\n".join(edittext), user)
  File "D:\Python25\Lib\site-packages\mercurial\ui.py", line 422, in edit
    text=True)
  File "D:\Python25\lib\tempfile.py", line 302, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags)
  File "D:\Python25\lib\tempfile.py", line 237, in _mkstemp_inner
    _set_cloexec(fd)
  File "D:\Python25\lib\tempfile.py", line 47, in _set_cloexec
    flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
  File "D:\Python25\Lib\site-packages\mercurial\demandimport.py", line 65, in
__getattribute__
    self._load()
  File "D:\Python25\Lib\site-packages\mercurial\demandimport.py", line 46, in _load
    mod = _origimport(head, globals, locals)
ImportError: No module named fcntl
transaction abort!
rollback completed
"""

I may be completely wrong but it seems demandmod is used by
standard/non-mercurial libraries and hides import errors:
"""
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> t = tempfile.TemporaryFile()
>>>
"""

but 

"""
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mercurial.demandimport; mercurial.demandimport.enable()
>>> import tempfile
>>> t = tempfile.TemporaryFile()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python25\lib\tempfile.py", line 435, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "D:\Python25\lib\tempfile.py", line 237, in _mkstemp_inner
    _set_cloexec(fd)
  File "D:\Python25\lib\tempfile.py", line 47, in _set_cloexec
    flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
  File "C:\dev\src\mercurial\hg-crew\mercurial\demandimport.py", line 65, in
__getattribute__
    self._load()
  File "C:\dev\src\mercurial\hg-crew\mercurial\demandimport.py", line 46, in _load
    mod = _origimport(head, globals, locals)
ImportError: No module named fcntl
"""

But my example may be completely irrelevant.

----------
messages: 2536
nosy: pmezard
priority: bug
status: unread
title: hg commit fails because of unavailable package import

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue453>
____________________________________________________



More information about the Mercurial-devel mailing list