use with open for internal handling of open errors
better description for resetting file object offset to 0
use python utf string handling for clearer naming of fname