Feed date scraper for Gemini (protocol)
retrieval: tolerate non-bytes data
Zach DeCook 2021-02-11
parent 2c1f535 · commit ac873ec
-rwxr-xr-xzachwalk.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/zachwalk.py b/zachwalk.py
index f2ecee1..fd8ed64 100755
--- a/zachwalk.py
+++ b/zachwalk.py
@@ -29,7 +29,8 @@ def getnewestdate(url):
return gnd(fp)
def gnd(fp):
for line in fp:
- line=line.decode('UTF-8')
+ if type(line) != str:
+ line=line.decode('UTF-8')
if line.strip()[0:2] == '=>':
try:
desc =getdesc(line)