What type is `fname` usually? If not `str` already, then I would say move this conversion to where this method is being called.