From patchwork Sat Apr 9 04:59:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Bug, 5194] New: importing crecord.py changes locale environment, breaks date parsing/formatting From: mercurial-bugs@selenic.com X-Patchwork-Id: 14450 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Sat, 09 Apr 2016 04:59:20 +0000 https://bz.mercurial-scm.org/show_bug.cgi?id=5194 Bug ID: 5194 Summary: importing crecord.py changes locale environment, breaks date parsing/formatting Product: Mercurial Version: default branch Hardware: PC OS: Windows Status: UNCONFIRMED Severity: bug Priority: normal Component: record Assignee: bugzilla@selenic.com Reporter: yuya@tcha.org CC: adrian@cadifra.com, mercurial-devel@selenic.com crecord.py initializes the locale to the user's default, which changes date formatting (and perhaps parsing.) https://selenic.com/repo/hg/file/3.7.3/mercurial/crecord.py#l32 On Japanese Windows XP (32bit), I got the following test failure because "Sep" isn't a valid month on Japanese locale of Windows. $ ./run-tests.py -l test-doctest.py --- z:/work/hghacks/mercurial-work/tests/test-doctest.py.out +++ z:/work/hghacks/mercurial-work/tests/test-doctest.py.err @@ -0,0 +1,28 @@ +********************************************************************** +File "z:\work\hghacks\mercurial-work\mercurial\util.py", line 1745, in mercurial.util.matchdate +Failed example: + p5 = parsedate("Sep 15 10:30:00 1999") +Exception raised: + Traceback (most recent call last): + File "c:\Python27\lib\doctest.py", line 1315, in __run + compileflags, 1) in test.globs + File "", line 1, in + p5 = parsedate("Sep 15 10:30:00 1999") + File "z:\work\hghacks\mercurial-work\mercurial\util.py", line 1717, in parsedate + raise Abort(_('invalid date: %r') % date) + Abort: invalid date: 'Sep 15 10:30:00 1999' -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel