[merge] Handle bad LANG

Martin Pool mbp at canonical.com
Sat Aug 26 01:52:21 BST 2006


On 25 Aug 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> Robert Collins wrote:
> > On Thu, 2006-08-24 at 16:47 -0500, John Arbash Meinel wrote:
> >> Right now if you set LANG to something unrecognized by python, you get
> >> an ugly traceback.
> >>
> >> The attached patch changes bzrlib so it falls back to just using 'ascii'
> >> after emitting a semi-helpful warning.
> >>
> >> I'm not 100% on the english of the warning, but I think it is reasonable.
> >>
> >> This is probably small enough for 0.10, but I'll let Robert decide.
> >>
> >> My only concern is that the test might be a little too brittle, because
> >> it expects a specific formatting for the locale.Error.
> > 
> > +1 for 0.11, not for 0.10 - it assumes LANG is everywhere and I'm
> > suspecting thats not fit for windows.
> 
> Well, LANG doesn't have an effect on windows, so for now I'm skipping
> the test.

(Just for clarity - Robert's the release manager and gets final say, so
let's carry this over to 0.11)

> Maybe BZR_PROGRESS_BAR. But I don't think it should do anything with
> LANG, as it isn't something that needs to be tested often.
> 
> I suppose instead we could pass environment vars to set/unset as part of
> run_bzr_subprocess.

That sounds good.  In general setting them while the process is
running is not a good idea.  (For example some systems scan $TZ at
libc startup and some every time it's needed.)  So

  run_bzr_subprocess(...,
      env_changes = {"REMOVE_ME": None, "LANG": "de_DE"})

-- 
Martin




More information about the bazaar mailing list