Opened 14 years ago
Closed 10 years ago
#3065 defect closed duplicate (duplicate)
imap relies on a C locale for date formatting
Reported by: | therve | Owned by: | argonemyth |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Keywords: | locale | |
Cc: | moijes12 | Branch: | |
Author: |
Description (last modified by )
spew_internaldate uses time.strftime, which is locale dependant. It should use something not relying on the locale.
The problem can be reproduce by running the imap test suite with gtk2 reactor and a non english locale (like fr_FR).
Change History (11)
comment:1 Changed 14 years ago by
Priority: | low → normal |
---|
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | test_imap relies on a C locale to test data formatting → imap relies on a C locale for date formatting |
Yeah it seems so. I've looked at the RFC (http://www.faqs.org/rfcs/rfc3501.html), and the format date-time uses date-month, and date-month explicitly lists the month in english abbreviated format.
comment:3 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 12 years ago by
Keywords: | locale added |
---|
comment:5 Changed 11 years ago by
Owner: | Jean-Paul Calderone deleted |
---|
comment:6 Changed 10 years ago by
Cc: | moijes12 added |
---|
So, if someone were to start working on this, where does he begin ?
comment:7 Changed 10 years ago by
Thanks for your interest in this ticket, moijes12. Can you explain what you're asking in more detail? Superficially, it seems like this ticket describes the issue in pretty good detail.
comment:8 Changed 10 years ago by
Owner: | set to argonemyth |
---|
comment:9 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
From what I read in the method spew_internaldate
, someone already fixed the problem and we already have a test for it: test_fetchInternalDateLocaleIndependent
.
Here is my local output from trial [trunk r35167]:
$ bin/trial -r gtk2 twisted.mail.test.test_imap.NewFetchTestCase.test_fetchInternalDateLocaleIndependent twisted.mail.test.test_imap NewFetchTestCase test_fetchInternalDateLocaleIndependent ... [OK] ------------------------------------------------------------------------------- Ran 1 tests in 0.059s PASSED (successes=1)
Just to make sure, I changed my locale to fr_FR.utf8
and ran the mail test suite with gtk2 reactor, all tests passed. I am going to close this ticket, if anyone still run into this issue, please re-open the ticket.
comment:10 Changed 10 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
comment:11 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
This is actually a bug in the implementation of date formatting, not in the tests. The resulting string should not vary depending on the locale of the server environment.