try:
size = headers["Content-Length"]
except KeyError:
- size = len(content)
+ pass
try:
last_modified = headers["Last-Modified"]
if last_modified:
last_modified = parse_time(last_modified)
- else:
+
+ if not size: # Could be None from headers
size = len(content)
if last_modified:
break
content_stripped = content.strip()
if content_stripped and is_html:
- parser = parse_html(content_stripped, charset, self.log)
+ parser = parse_html(
+ content_stripped, charset, self.log)
if charset:
bookmark.charset = charset
elif parser and parser.meta_charset: