Opened 7 years ago

Closed 2 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: mail Keywords: locale
Cc: moijes12@… Branch:
Author: Launchpad Bug:

Description (last modified by therve)

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 7 years ago by exarkun

  • Priority changed from low to normal

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.

comment:2 Changed 7 years ago by therve

  • Description modified (diff)
  • Summary changed from test_imap relies on a C locale to test data formatting to 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 7 years ago by therve

  • Description modified (diff)

comment:4 Changed 4 years ago by jml

  • Keywords locale added

comment:5 Changed 4 years ago by <automation>

  • Owner exarkun deleted

comment:6 Changed 3 years ago by moijes12

  • Cc moijes12@… added

So, if someone were to start working on this, where does he begin ?

comment:7 Changed 2 years ago by exarkun

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 2 years ago by exarkun

  • Owner set to argonemyth

comment:9 Changed 2 years ago by argonemyth

  • Resolution set to worksforme
  • Status changed from new to 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 2 years ago by exarkun

  • Resolution worksforme deleted
  • Status changed from closed to reopened

This was fixed by #4937, which was a duplicate of this ticket. Marking this one as the duplicate, since #4937 is already resolved.

comment:11 Changed 2 years ago by exarkun

  • Resolution set to duplicate
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.