FIX: more Python 3 fixes for doc/gen_rst.py