# Buggy code
def check_package_data(dist, attr, value):
    """Verify that value is a dictionary of package names to glob lists"""
    if isinstance(value, dict):
        for k, v in value.items():
            if not isinstance(k, str):
                break
            try:
                iter(v)
            except TypeError:
                break
        else:
            return
    raise DistutilsSetupError(
        attr + " must be a dictionary mapping package names to lists of "
        "wildcard patterns"
    )


# Traceback (ValueError)
%CMD_IN_ENV% pip install .
Processing c:\projects\manubot
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\manubot.egg-info
writing pip-egg-info\manubot.egg-info\PKG-INFO
writing dependency_links to pip-egg-info\manubot.egg-info\dependency_links.txt
writing entry points to pip-egg-info\manubot.egg-info\entry_points.txt
writing requirements to pip-egg-info\manubot.egg-info\requires.txt
writing top-level names to pip-egg-info\manubot.egg-info\top_level.txt
writing manifest file 'pip-egg-info\manubot.egg-info\SOURCES.txt'
c:\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-akczu3gv\setup.py", line 75, in <module>
'manubot': 'cite/*.lua',
File "c:\python36\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python36\lib\site-packages\setuptools\command\egg_info.py", line 278, in run
self.find_sources()
File "c:\python36\lib\site-packages\setuptools\command\egg_info.py", line 293, in find_sources
mm.run()
File "c:\python36\lib\site-packages\setuptools\command\egg_info.py", line 524, in run
self.add_defaults()
File "c:\python36\lib\site-packages\setuptools\command\egg_info.py", line 560, in add_defaults
sdist.add_defaults(self)
File "c:\python36\lib\site-packages\setuptools\command\py36compat.py", line 34, in add_defaults
self._add_defaults_python()
File "c:\python36\lib\site-packages\setuptools\command\sdist.py", line 134, in _add_defaults_python
for _, src_dir, _, filenames in build_py.data_files:
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 66, in __getattr__
self.data_files = self._get_data_files()
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 83, in _get_data_files
return list(map(self._get_pkg_data_files, self.packages or ()))
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 95, in _get_pkg_data_files
for file in self.find_data_files(package, src_dir)
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 114, in find_data_files
return self.exclude_data_files(package, src_dir, files)
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 198, in exclude_data_files
files = list(files)
File "c:\python36\lib\site-packages\setuptools\command\build_py.py", line 234, in <genexpr>
for pattern in raw_patterns
File "c:\python36\lib\distutils\util.py", line 125, in convert_path
raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/' cannot be absolute

# Fixed code
def check_package_data(dist, attr, value):
    """Verify that value is a dictionary of package names to glob lists"""
    if not isinstance(value, dict):
        raise DistutilsSetupError(
            "{!r} must be a dictionary mapping package names to lists of "
            "string wildcard patterns".format(attr)
        )
    for k, v in value.items():
        if not isinstance(k, six.string_types):
            raise DistutilsSetupError(
                "keys of {!r} dict must be strings (got {!r})".format(attr, k)
            )
        assert_string_list(dist, "values of {!r} dict".format(attr), v)