

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in org.python.python-bugs-list[ python-Bugs-883604 ] locale specifi...| From | Sent On | Attachments |
|---|---|---|
| SourceForge.net | Mar 20, 2004 12:32 pm | |
| SourceForge.net | Mar 20, 2004 6:24 pm | |
| SourceForge.net | Mar 20, 2004 9:19 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | [ python-Bugs-883604 ] locale specific problem in test_strftime.py | Actions... |
|---|---|---|
| From: | SourceForge.net (nore...@sourceforge.net) | |
| Date: | Mar 20, 2004 6:24:15 pm | |
| List: | org.python.python-bugs-list | |
Bugs item #883604, was opened at 2004-01-24 05:21 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=883604&group_id=5470
Category: Python Library Group: Python 2.3
Status: Closed Resolution: Fixed
Priority: 3 Submitted By: George Yoshida (quiver) Assigned to: Brett Cannon (bcannon) Summary: locale specific problem in test_strftime.py
Initial Comment: test/test_strftime.py compares an expectation and a result by regular expressions, but the pattern isn't escaped. So if the expectation includes a metacharacter, expectation == result and re.match(expectation, result) do not always return the same value.
In my case on Japanese Windows, time.tzname returns ('\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)', '\x93 \x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)') The output contains parentheses. This resuls in a message: Conflict for nonstandard '%Z' format (time zone name): Expected ???? (?W????), but got ???? (?W????) re.match(foo, bar) != (foo == bar)
One workaround I can think of is changing re.match(e [1], result) back to result == e[1].
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2004-03-20 15:24
Message: Logged In: YES user_id=357491
Fixed in rev. 1.29 of Lib/test/test_strftime.py in Python 2.4 and rev. 1.27.16.1 for Python 2.3 .
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon) Date: 2004-03-20 09:32
Message: Logged In: YES user_id=357491
George, can you apply the attached patch and let me know if it solves the problem?
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon) Date: 2004-01-29 18:23
Message: Logged In: YES user_id=357491
That's not what I meant by the comment; sorry for not being clearer. I meant is whether test_strftime's existence is because of Jython.
----------------------------------------------------------------------
Comment By: George Yoshida (quiver) Date: 2004-01-29 03:54
Message: Logged In: YES user_id=671362
Is this for Jython or something?
No, it's Python 2.3.3 on Windows 2000.
time zone is classified as non standard(unpredictable) so it might be difficult to make test_stftime.py to support all locales. There are so many issues.
FYI, I checked time.tzname on other platforms.
# Jython Jython 2.1 on java1.4.2 (JIT: null) Type "copyright", "credits" or "license" for more information.
import time time.tzname
('JST', 'JST') # Japanese Standard Time
# Linux On RHL 9.0(Python 2.2/2.3), time.tzname returns ('JST', 'JST').
They pass the test.
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon) Date: 2004-01-27 00:28
Message: Logged In: YES user_id=357491
Does anyone know why we even have test_strftime? It isn't like we have our own implementation and there are basic tests in test_time to make sure the wrapper around the C function works. I know the test module says it is for sanity checks, but if it fails legitimately on a platform there is not much we can do about it. Is this for Jython or something?
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=883604&group_id=5470







