[issue3196] largefiles: localized exception passed through

Andrei Polushin bugs at mercurial.selenic.com
Thu Jan 12 06:49:14 CST 2012


New submission from Andrei Polushin <polushin at gmail.com>:

First, look at hgext/largefiles/overrides.py:

415:        except util.Abort, e:
416:            if str(e) != 'no files to copy':
417:                raise e

502:        except util.Abort, e:
503:            if str(e) != 'no files to copy':
504:                raise e

511:    if nolfiles and nonormalfiles:
512:        raise util.Abort(_('no files to copy'))

The exception raised with i18n-ed string, while except statement checks for
plain string. As a result, the exception is not caught on localized systems.

Steps to reproduce:
1. Use localized Mercurial
2. Enable largefiles extension
3. On existing repository, try to rename any file: hg move foo bar

Result:
1. The file is moved successfully
2. Extra message is printed, in its localized form:
   abort: no files to copy

Expected result:
   No extra message is expected.

----------
messages: 18595
nosy: polushin
priority: bug
status: unread
title: largefiles: localized exception passed through

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


More information about the Mercurial-devel mailing list