mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
parent
dd7b0525e9
commit
5a096e1b10
6 changed files with 28 additions and 28 deletions
|
@ -452,7 +452,7 @@ class URLopener:
|
|||
|
||||
def open_local_file(self, url):
|
||||
"""Use local file."""
|
||||
import mimetypes, mimetools, email.Utils
|
||||
import mimetypes, mimetools, email.utils
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
|
@ -464,7 +464,7 @@ class URLopener:
|
|||
except OSError, e:
|
||||
raise IOError(e.errno, e.strerror, e.filename)
|
||||
size = stats.st_size
|
||||
modified = email.Utils.formatdate(stats.st_mtime, usegmt=True)
|
||||
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' %
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue