[Svnmerge] KeyError on svnmerge.py

Hernan Martinez-Foffani Silva hernan.martinez at ecc.es
Sun Mar 9 08:51:10 PDT 2008


> >>> One question: is using LC_MESSAGES=C enough to fix the regression? In
> >>> that case, I would assume that LC_MESSAGES would only affect SVN's own
> >>> strings and not log messages. It would be a win-win.
> >> Good idea, but svn doesn't seem to respect LC_MESSAGES for the output
> >> of svn info:
> >>
> >> # export LC_ALL=de_DE
> >> # svn info | head -1
> >> Pfad: .
> >>
> >> # LC_MESSAGES=C svn info | head -1
> >> Pfad: .
> >>
> >> # LC_ALL=C svn info | head -1
> >> Path: .
> >
> > I see. I guess this changed in later SVN versions (given that
> > svnmerge.sh used to use LC_MESSAGES), but never mind.
>
> LC_MESSAGES is respected by svn, as long as LC_ALL is *not* set. This
> is apparently correct POSIX behavior:
>
> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#tag_08_02
>
> Also, Hernan has shown that svn *does* override the Windows regional
> settings with the value of LC_MESSAGES. So the Windows regional
> settings are roughly equivalent to the UNIX LANG variable.
>
> Therefore, should the attached patch solve the issue?
>
> I don't know if this will regress svnmerge.py on Romulo's problem. The
> testCommitMessageEncoding test case passes on my machine, but the test
> case is heavily dependent on the machine environment in which it is
> run. It would be helpful if Romulo could test this but I've been
> getting bounces on his email address.

I've just tested your patch against trunk and as far as I can tell everything is
working now under my environment: Spanish Windows XP SP2.
The svnmerge.py test suite pass and Romulo's script shows the expected output.

Follows the test suite output and attached the output of Romulo's script.

Regards,
-Hernan.

---------------------------------------------------------

D:\proyectos\svnmerge>svn status
M      svnmerge.py

D:\proyectos\svnmerge>svn diff
Index: svnmerge.py
===================================================================
--- svnmerge.py (revisión: 29812)
+++ svnmerge.py (copia de trabajo)
@@ -94,6 +94,12 @@
 # the locale to match that encoding
 locale.setlocale(locale.LC_ALL, '')

+# We want the svn output (such as svn info) to be non-localized
+# Using LC_MESSAGES should not affect localized output of svn log, for example
+if os.environ.has_key("LC_ALL"):
+    del os.environ["LC_ALL"]
+os.environ["LC_MESSAGES"] = "C"
+
 ###############################################################################
 # Support for older Python versions
 ###############################################################################

D:\proyectos\svnmerge>svnmerge_test.py
..................................................
----------------------------------------------------------------------
Ran 50 tests in 159.140s

OK

D:\proyectos\svnmerge>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Romulos_Script.txt
URL: </pipermail/svnmerge/attachments/20080309/a836a7c4/attachment-0002.txt>


More information about the Svnmerge mailing list