[issue1897] Exception Raised While Handling Exceptions in ``_runcatch``

gregweb bugs at mercurial.selenic.com
Tue Nov 3 10:47:17 UTC 2009


New submission from gregweb <gregoire.weber at gmail.com>:

The exceptions instance raised has an ``args`` attribute, which is an 
empty tuple. This causes an exception be raised during exception 
handling hiding the original exception::

  Traceback (most recent call last):
    File "/home/myusername/virtual-python/hg/bin/hg", line 5, in <module>
      pkg_resources.run_script('mercurial==1.3.1', 'hg')
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 448, in run_script
      self.require(requires)[0].run_script(script_name, ns)
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 1166, in run_script
      execfile(script_filename, namespace, namespace)
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/mercurial-1.3.1-py2.5-linux-x86_64.egg/EGG-INFO/scripts/hg",
line 27, in <module>
      mercurial.dispatch.run()
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/mercurial-1.3.1-py2.5-linux-x86_64.egg/mercurial/dispatch.py",
line 16, in run
      sys.exit(dispatch(sys.argv[1:]))
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/mercurial-1.3.1-py2.5-linux-x86_64.egg/mercurial/dispatch.py",
line 27, in dispatch
      return _runcatch(u, args)
    File
"/home/myusername/virtual-python/hg/lib/python2.5/site-packages/mercurial-1.3.1-py2.5-linux-x86_64.egg/mercurial/dispatch.py",
line 111, in _runcatch
      elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE:
  IndexError: tuple index out of range

This happened while trying to clone a quite big svn repository using 
hgsubversion. Nevertheless I think this case must be handled by mercurial
anyway even if it is not the root of the error.

Patch attached.

Version Info:
- mercurial 1.3.1 (from PyPi)
- hgsubversion rev 5ddc212dbc56 (from hg repo)
- everything in a python-virtualenv on a debian lenny 64Bit box

----------
files: empty-exception-patch.diff
messages: 10873
nosy: gregweb
priority: bug
status: unread
title: Exception Raised While Handling Exceptions in ``_runcatch``

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue1897>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: empty-exception-patch.diff
Type: text/x-diff
Size: 664 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20091103/c0b702b1/attachment.diff 


More information about the Mercurial-devel mailing list