fix file fun in py3

rt.