readwrite.py: more debugging logic

Signed-off-by: Joe Buck <jbbuck@gmail.com>