mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
hashlib.sha1() must take bytes, not unicode
This commit is contained in:
parent
c31b912103
commit
9f88993281
@ -70,7 +70,7 @@ class ImageDownloader(BaseImageConverter):
|
||||
if '?' in basename:
|
||||
basename = basename.split('?')[0]
|
||||
if basename == '':
|
||||
basename = sha1(node['uri']).hexdigest()
|
||||
basename = sha1(node['uri'].encode("utf-8")).hexdigest()
|
||||
dirname = node['uri'].replace('://', '/').translate({ord("?"): u"/",
|
||||
ord("&"): u"/"})
|
||||
ensuredir(os.path.join(self.imagedir, dirname))
|
||||
|
Loading…
Reference in New Issue
Block a user