From 315d845739709e225a90b9089d3f980b9cfde7e6 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 30 Aug 2007 03:06:59 +0000 Subject: Revert revisions 57472, 57474, and 57477 which disabled some tests when the email package was removed. Email was restored, so restore the tests. --- Lib/urllib.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'Lib/urllib.py') diff --git a/Lib/urllib.py b/Lib/urllib.py index 6bf89ee8f9..3035881046 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -403,7 +403,7 @@ class URLopener: def open_local_file(self, url): """Use local file.""" - import mimetypes, mimetools #, email.utils + import mimetypes, mimetools, email.utils from io import StringIO host, file = splithost(url) localname = url2pathname(file) @@ -412,17 +412,7 @@ class URLopener: except OSError as e: raise IOError(e.errno, e.strerror, e.filename) size = stats.st_size - # XXX(nnorwitz): inline formatdate until it is restored. - #modified = email.utils.formatdate(stats.st_mtime, usegmt=True) - now, zone = time.gmtime(stats.st_mtime), 'GMT' - modified = '%s, %02d %s %04d %02d:%02d:%02d %s' % ( - ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][now[6]], - now[2], - ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][now[1] - 1], - now[0], now[3], now[4], now[5], - zone) - + modified = email.utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO( 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % -- cgit v1.2.1