[Python-Dev] cygwin errors (original) (raw)
Brett C. drifty@alum.berkeley.edu
Tue, 22 Jul 2003 13:56:04 -0700
- Previous message: [Python-Dev] cygwin errors
- Next message: [Python-Dev] cygwin errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tim Peters wrote:
[Brett C.]
... I can try to see what the problems are if someone can run::
>>> import time >>> time.strftime("%c") >>> import strptime >>> strptime.TimeRE()['c'] after running testlogging to trigger the failure. There is no failure anymore, because Jermey added if curlocale: locale.setlocale(locale.LCALL, "C") to the end of testlogging.py. This almost certainly isn't a correct fix, though (testlogging should restore the locale to what it was before testlogging started just as a matter of cleaning up after itself, but it remains surprising that teststrptime fails if testlogging doesn't). If you revert his change, then, e.g., C:\Code\python\PCbuild>python ../lib/test/regrtest.py testlogging teststrptime testlogging teststrptime test teststrptime failed -- Traceback (most recent call last): File "C:\Code\python\lib\test\teststrptime.py", line 96, in testlang "Setting of lang failed") File "C:\Code\python\lib\unittest.py", line 268, in failUnless if not expr: raise self.failureException, msg AssertionError: Setting of lang failed 1 test OK. 1 test failed: teststrptime C:\Code\python\PCbuild> At the point teststrptime fails, on my box the relevant expressions have the following values: self.LTins.lang 'EnglishUnited States' locale.getdefaultlocale()[0] 'enUS' locale.getlocale(locale.LCTIME) ['EnglishUnited States', '1252'] so self.failUnless(self.LTins.lang in (locale.getdefaultlocale()[0], locale.getlocale(locale.LCTIME), ''), "Setting of lang failed") fails. It doesn't look like the test code expects locale.getlocale(locale.LCTIME) to return a list, but I don't know what's expected here ...
Argh! The test is wrong. It should be locale.getlocale(locale.LC_TIME)[0] that is being checked against. Crap, sorry to have caused all of this trouble over such a stupid little mistake. I am personally amazed it took so long for the error to show up.
I can check this minute change in, but what branch/tag/thing do you want it done to?
-Brett
- Previous message: [Python-Dev] cygwin errors
- Next message: [Python-Dev] cygwin errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]