summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-30 03:06:59 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-30 03:06:59 (GMT)
commit315d845739709e225a90b9089d3f980b9cfde7e6 (patch)
tree6fdf54da4d95fca4ca1fa45e8ec46aebc2efb6a4 /Lib
parent8b3d659692b6d092991dc3b5b4042547f885fa8c (diff)
downloadcpython-315d845739709e225a90b9089d3f980b9cfde7e6.zip
cpython-315d845739709e225a90b9089d3f980b9cfde7e6.tar.gz
cpython-315d845739709e225a90b9089d3f980b9cfde7e6.tar.bz2
Revert revisions 57472, 57474, and 57477 which disabled some tests
when the email package was removed. Email was restored, so restore the tests.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pyclbr.py2
-rw-r--r--Lib/test/test_zipfile.py1
-rw-r--r--Lib/urllib.py14
-rw-r--r--Lib/urllib2.py14
4 files changed, 5 insertions, 26 deletions
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index fe0141c..caccf11 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -175,7 +175,7 @@ class PyclbrTest(TestCase):
cm('pydoc')
# Tests for modules inside packages
- #cm('email.parser')
+ cm('email.parser')
cm('test.test_pyclbr')
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index db2b34b..ee8150e 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -439,7 +439,6 @@ class PyZipFileTests(unittest.TestCase):
zipfp.close()
def testWritePythonPackage(self):
- return # XXX(nnorwitz): disable test until email is checked in again.
import email
packagedir = os.path.dirname(email.__file__)
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 6bf89ee..3035881 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' %
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 32fb205..72e2899 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -1204,7 +1204,7 @@ class FileHandler(BaseHandler):
# not entirely sure what the rules are here
def open_local_file(self, req):
- #import email.utils
+ import email.utils
import mimetypes
host = req.get_host()
file = req.get_selector()
@@ -1212,17 +1212,7 @@ class FileHandler(BaseHandler):
try:
stats = os.stat(localfile)
size = stats.st_size
- #modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
- # XXX(nnorwitz): inline formatdate until it is restored.
- 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(file)[0]
headers = mimetools.Message(StringIO(
'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %