mirror of https://github.com/scrapy/scrapy.git
replace rfc822 with email.utils
This commit is contained in:
parent
757f983a97
commit
683ef2a8d9
|
|
@ -7,9 +7,9 @@ See documentation in topics/media-pipeline.rst
|
|||
import hashlib
|
||||
import os
|
||||
import os.path
|
||||
import rfc822
|
||||
import time
|
||||
import logging
|
||||
from email.utils import parsedate_tz, mktime_tz
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from collections import defaultdict
|
||||
import six
|
||||
|
|
@ -91,8 +91,8 @@ class S3FilesStore(object):
|
|||
def _onsuccess(boto_key):
|
||||
checksum = boto_key.etag.strip('"')
|
||||
last_modified = boto_key.last_modified
|
||||
modified_tuple = rfc822.parsedate_tz(last_modified)
|
||||
modified_stamp = int(rfc822.mktime_tz(modified_tuple))
|
||||
modified_tuple = parsedate_tz(last_modified)
|
||||
modified_stamp = int(mktime_tz(modified_tuple))
|
||||
return {'checksum': checksum, 'last_modified': modified_stamp}
|
||||
|
||||
return self._get_boto_key(path).addCallback(_onsuccess)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ def iter_errback(iterable, errback, *a, **kw):
|
|||
iterating it.
|
||||
"""
|
||||
it = iter(iterable)
|
||||
while 1:
|
||||
while True:
|
||||
try:
|
||||
yield next(it)
|
||||
except StopIteration:
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ def md5sum(file):
|
|||
'784406af91dd5a54fbb9c84c2236595a'
|
||||
"""
|
||||
m = hashlib.md5()
|
||||
while 1:
|
||||
while True:
|
||||
d = file.read(8096)
|
||||
if not d:
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in New Issue