# Buggy code
def find_file(self, path, saltenv, back=None):
    """
    Find the path and return the fnd structure, this structure is passed
    to other backend interfaces.
    """
    back = self._gen_back(back)
    kwargs = {}
    fnd = {"path": "", "rel": ""}
    if os.path.isabs(path):
        return fnd
    if "../" in path:
        return fnd
    if salt.utils.url.is_escaped(path):
        # don't attempt to find URL query arguements in the path
        path = salt.utils.url.unescape(path)
    else:
        if "?" in path:
            hcomps = path.split("?")
            path = hcomps[0]
            comps = hcomps[1].split("&")
            for comp in comps:
                if "=" not in comp:
                    # Invalid option, skip it
                    continue
                args = comp.split("=", 1)
                kwargs[args[0]] = args[1]
    if "env" in kwargs:
        salt.utils.warn_until(
            "Boron",
            "Passing a salt environment should be done using 'saltenv' "
            "not 'env'. This functionality will be removed in Salt "
            "Boron.",
        )
        saltenv = kwargs.pop("env")
    elif "saltenv" in kwargs:
        saltenv = kwargs.pop("saltenv")
    for fsb in back:
        fstr = "{0}.find_file".format(fsb)
        if fstr in self.servers:
            fnd = self.servers[fstr](path, saltenv, **kwargs)
            if fnd.get("path"):
                fnd["back"] = fsb
                return fnd
    return fnd


# Traceback (AttributeError)
# salt-run fileserver.file_list saltenv=1.0
Exception occurred in runner fileserver.file_list: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/client/mixins.py", line 337, in low
data['return'] = self.functions[fun](*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/runners/fileserver.py", line 83, in file_list
output = fileserver.file_list(load=load)
File "/usr/lib/python2.7/dist-packages/salt/fileserver/__init__.py", line 555, in file_list
ret.update(self.servers[fstr](load))
File "/usr/lib/python2.7/dist-packages/salt/fileserver/gitfs.py", line 180, in file_list
return gitfs.file_list(load)
File "/usr/lib/python2.7/dist-packages/salt/utils/gitfs.py", line 2255, in file_list
return self._file_lists(load, 'files')
File "/usr/lib/python2.7/dist-packages/salt/utils/gitfs.py", line 2216, in _file_lists
'{0}.p'.format(load['saltenv'].replace(os.path.sep, '_|-'))
AttributeError: 'float' object has no attribute 'replace'

# Fixed code
def find_file(self, path, saltenv, back=None):
    """
    Find the path and return the fnd structure, this structure is passed
    to other backend interfaces.
    """
    back = self._gen_back(back)
    kwargs = {}
    fnd = {"path": "", "rel": ""}
    if os.path.isabs(path):
        return fnd
    if "../" in path:
        return fnd
    if salt.utils.url.is_escaped(path):
        # don't attempt to find URL query arguements in the path
        path = salt.utils.url.unescape(path)
    else:
        if "?" in path:
            hcomps = path.split("?")
            path = hcomps[0]
            comps = hcomps[1].split("&")
            for comp in comps:
                if "=" not in comp:
                    # Invalid option, skip it
                    continue
                args = comp.split("=", 1)
                kwargs[args[0]] = args[1]
    if "env" in kwargs:
        salt.utils.warn_until(
            "Boron",
            "Passing a salt environment should be done using 'saltenv' "
            "not 'env'. This functionality will be removed in Salt "
            "Boron.",
        )
        saltenv = kwargs.pop("env")
    elif "saltenv" in kwargs:
        saltenv = kwargs.pop("saltenv")
    if not isinstance(saltenv, six.string_types):
        saltenv = six.text_type(saltenv)

    for fsb in back:
        fstr = "{0}.find_file".format(fsb)
        if fstr in self.servers:
            fnd = self.servers[fstr](path, saltenv, **kwargs)
            if fnd.get("path"):
                fnd["back"] = fsb
                return fnd
    return fnd