[PATCH] patchbomb: fix From_ in the message's envelope

Cedric Duval cedricduval at free.fr
Sun Jul 5 17:19:49 CDT 2009


Greg Ward wrote:
> 2009/7/5 Cédric Duval <cedricduval at free.fr>:
> > # HG changeset patch
> > # User Cédric Duval <cedricduval at free.fr>
> > # Date 1246804930 -7200
> > # Node ID f115a5155195bb05b470ed1bff72339fa500f4b2
> > # Parent  8761863c3118bfd1627c5e66b7ea29f131188ea4
> > patchbomb: fix From_ in the message's envelope

> > Localized date in the From_ prevents MUAs like mutt from parsing mbox files
> > generated by patchbomb. Using a 24 characters date in asctime format instead.

> Is it possible to add a failing test by running something like
> "LANG=fr hg email ..."?  That would help ensure this bug stays fixed.

The problem is that AFAIK apart from the C/POSIX locale, no locale is
guaranteed to exist on a system. Such a test would only be effective
for a system with the given locale.

E.g. with a random locale:
  % LANG=nb_NO date
  Mon Jul  6 00:14:51 CEST 2009
  % python
  >>> import locale
  >>> locale.setlocale(locale.LC_TIME, 'nb_NO')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.5/locale.py", line 478, in setlocale
      return _setlocale(category, locale)
  locale.Error: unsupported locale setting

Then after generating the bokmål locale on my system:
  % LANG=nb_NO date
  ma. 06. juli 00:16:50 +0200 2009
  % python
  >>> import locale
  >>> locale.setlocale(locale.LC_TIME, 'nb_NO')
  'nb_NO'

I'm not sure how such a test could be written, that would behave reliably.
-- 
Cédric


More information about the Mercurial-devel mailing list