Skip to content

Commit 92ac0c4

Browse files
author
Richard Jones
committed
fix Date: header generation to be LOCALE-agnostic [SF#1352624]
1 parent d789908 commit 92ac0c4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Fixed:
4444
- fixed documentation of filter() in the case of multiple values in a
4545
String search (sf bug 1373396)
4646
- fix comma-separated ID filter spec in web requests (sf bug 1396278)
47+
- fix Date: header generation to be LOCALE-agnostic (sf bug 1352624)
4748

4849

4950
2005-10-07 0.8.5

roundup/mailer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sending Roundup-specific mail over SMTP.
22
"""
33
__docformat__ = 'restructuredtext'
4-
# $Id: mailer.py,v 1.10 2004-07-25 15:25:44 a1s Exp $
4+
# $Id: mailer.py,v 1.11 2006-01-13 02:38:45 richard Exp $
55

66
import time, quopri, os, socket, smtplib, re
77

@@ -11,6 +11,12 @@
1111
from roundup.rfc2822 import encode_header
1212
from roundup import __version__
1313

14+
try:
15+
from email.Utils import formatdate
16+
except ImportError:
17+
def formatdate(timeval):
18+
return time.strftime("%a, %d %b %Y %H:%M:%S +0000", timeval)
19+
1420
class MessageSendError(RuntimeError):
1521
pass
1622

@@ -54,8 +60,7 @@ def get_standard_message(self, to, subject, author=None):
5460
writer.addheader('Subject', encode_header(subject, charset))
5561
writer.addheader('To', ', '.join(to))
5662
writer.addheader('From', author)
57-
writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000",
58-
time.gmtime()))
63+
writer.addheader('Date', formatdate(time.gmtime()))
5964

6065
# Add a unique Roundup header to help filtering
6166
writer.addheader('X-Roundup-Name', encode_header(tracker_name,

0 commit comments

Comments
 (0)