python3 fixes, mostly for open() #113