I have just posted an updated recipe in the recipes forum for the Russian Аргументы и Факты. (#5 in
https://www.mobileread.com/forums/sh...d.php?t=123726). This required modification to news.py to handle Unicode byte strings as well as str type. I'm posting these here as a suggested change which may help others who encounter file or directory names of type 'bytes'. I am not familiar enough with git to attempt a "merge directive".
1) in canonicalize_internal_url(self, url, is_link=True):
replace
return frozenset([(parts.netloc, (parts.path or '').rstrip('/'))])
by
zzp = parts.path
zzn = parts.netloc
if type(zzp) != type(' '): #"<class 'bytes'>":
zzp = parts.path.decode("utf-8")
zzn = parts.netloc.decode("utf-8")
return frozenset([(zzn, (zzp or '').rstrip('/'))])
2) In article_downloaded(self, request, result):
replace
index = os.path.join(os.path.dirname(result[0]), 'index.html')
by
zzr = result[0]
if type(zzr) != type(' '):
zzr = result[0].decode("utf-8")
index = os.path.join(os.path.dirname(zzr), 'index.html')