print("Checking an archived edit")
print("---------------")
reverting, reverted, reverted_to = \
mwreverts.db.check_archive(enwiki, 21995518)
print("reverting:", format_revert(reverting))
print("reverted:", format_revert(reverted))
print("reverted_to:", format_revert(reverted_to))
When a revision is not found in the archive table, it outputs the below error:
---------------
Checking an archived edit
---------------
Traceback (most recent call last):
File "demo_db_check.py", line 51, in <module>
mwreverts.db.check_archive(enwiki, 21995518)
File "/mnt/nfs/labstore-secondary-tools-home/diyi/delete_check/python-mwreverts/mwreverts/db.py", line 256, in check_archive
get_archived_namespace_title_and_timestamp(schema, rev_id)
File "/mnt/nfs/labstore-secondary-tools-home/diyi/delete_check/python-mwreverts/mwreverts/db.py", line 199, in get_archived_namespace_title_and_timestamp
return row[0], row[1], Timestamp(row[2])
TypeError: 'NoneType' object is not subscriptable
This error should be reported more friendly.