def get_pkg_data_fileobj(data_name, package=None, encoding=None, cache=True):
 datafn = _find_pkg_data_path(data_name, package=package)
 if os.path.isdir(datafn):
  raise IOError(u"Tried to access a data file that's actually a package data directory")
 elif os.path.isfile(datafn):
  return get_readable_fileobj(datafn, encoding=encoding)
 else:
  return get_readable_fileobj((conf.dataurl + datafn), encoding=encoding, cache=cache)

def get_pkg_data_fileobj ( data_name , package = None , encoding = None , cache = True ) : datafn = _find_pkg_data_path ( data_name , package = package ) if os . path . isdir ( datafn ) : raise IOError ( u"Tried to access a data file that's actually a package data directory" ) elif os . path . isfile ( datafn ) : return get_readable_fileobj ( datafn , encoding = encoding ) else : return get_readable_fileobj ( ( conf . dataurl + datafn ) , encoding = encoding , cache = cache )
retrieves a data file from the standard locations for the package and provides the file as a file-like object that reads bytes .