New GitHub issue #118510 from sshedi:<br>
<hr>
<pre>
# Bug report
### Bug description:
I have a machine where there was a leftover setuptools-57.4.0.dist-info directory after package removal.
`/lib/python3.10/site-packages/setuptools-57.4.0.dist-info` --> this directory is empty
And newer setuptools `/lib/python3.10/site-packages/setuptools-65.5.1-py3.10.egg-info/` is also present and this has content in it.
And I tried building a python project using `python3 setup.py build`
For example, this project `https://github.com/Supervisor/supervisor`
And it throws error like below:
```
root@photon [ ~/supervisor-4.2.2 ]# python3 setup.py build
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'extras_require'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
running build
running build_py
```
And if I do:
`rmdir /lib/python3.10/site-packages/setuptools-57.4.0.dist-info`
And then try the build, it works fine.
```
root@photon [ ~/supervisor-4.2.2 ]# python3 setup.py build
running build
running build_py
running egg_info
writing supervisor.egg-info/PKG-INFO
writing dependency_links to supervisor.egg-info/dependency_links.txt
writing entry points to supervisor.egg-info/entry_points.txt
writing requirements to supervisor.egg-info/requires.txt
writing top-level names to supervisor.egg-info/top_level.txt
reading manifest file 'supervisor.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'docs/.build'
adding license file 'LICENSES.txt'
writing manifest file 'supervisor.egg-info/SOURCES.txt'
/usr/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'supervisor.scripts' as data is deprecated, please list it in `packages`.
!!
############################
# Package would be ignored #
############################
...
...
```
is there a known issue in python3 or a way to tell python to ignore such empty directories?
This seems to be a regression.
PS:
This issue is not seen in python-3.11.7
### CPython versions tested on:
3.10
### Operating systems tested on:
Linux
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/118510">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>