Fixed "LookupError: 'hex' is not a text encoding" on /StatsBootstrapper page (#2442)

* Fixed "LookupError: 'hex' is not a text encoding"

* Fixed  KeyError: 'ip4'
This commit is contained in:
krzotr 2020-02-27 00:48:26 +01:00 committed by GitHub
parent 6218a92895
commit 2862587c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class UiRequestPlugin(object):
).fetchall()
yield "<br>%s (added: %s, peers: %s)<br>" % (
str(hash_row["hash"]).encode("hex"), hash_row["date_added"], len(peer_rows)
str(hash_row["hash"]).encode().hex(), hash_row["date_added"], len(peer_rows)
)
for peer_row in peer_rows:
yield " - {ip4: <30} {onion: <30} added: {date_added}, announced: {date_announced}<br>".format(**dict(peer_row))
yield " - {type} {address}:{port} added: {date_added}, announced: {date_announced}<br>".format(**dict(peer_row))