Added a usegmt flag to email.Utils.formatdate - this allows it to be
used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must
be the timezone string).
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 2969ef0..e2f01c5 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -410,7 +410,7 @@
def open_local_file(self, url):
"""Use local file."""
- import mimetypes, mimetools, rfc822, StringIO
+ import mimetypes, mimetools, email.Utils, StringIO
host, file = splithost(url)
localname = url2pathname(file)
try:
@@ -418,7 +418,7 @@
except OSError, e:
raise IOError(e.errno, e.strerror, e.filename)
size = stats.st_size
- modified = rfc822.formatdate(stats.st_mtime)
+ modified = email.Utils.formatdate(stats.st_mtime, usegmt=True)
mtype = mimetypes.guess_type(url)[0]
headers = mimetools.Message(StringIO.StringIO(
'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' %