Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in dist_info command - TypeError #1196

Open
jaraco opened this issue Nov 12, 2017 · 1 comment
Open

Error in dist_info command - TypeError #1196

jaraco opened this issue Nov 12, 2017 · 1 comment
Labels
bug help wanted Needs Investigation Issues which are likely in scope but need investigation to figure out the cause

Comments

@jaraco
Copy link
Member

jaraco commented Nov 12, 2017

Consider this setup.py:

$ cat setup.py
import setuptools
setuptools.setup(
name='package',
version='0.0.0',
)

produces this error:

$ rwt wheel -- setup.py dist_info       
Collecting wheel
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.30.0
running dist_info
writing setuptools.egg-info/PKG-INFO
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing entry points to setuptools.egg-info/entry_points.txt
writing requirements to setuptools.egg-info/requires.txt
writing top-level names to setuptools.egg-info/top_level.txt
reading manifest file 'setuptools.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'setuptools/_vendor'
writing manifest file 'setuptools.egg-info/SOURCES.txt'
creating '/Users/jaraco/Dropbox/code/main/setuptools/setuptools.dist-info'
Traceback (most recent call last):
  File "setup.py", line 188, in <module>
    dist = setuptools.setup(**setup_params)
  File "/Users/jaraco/Dropbox/code/main/setuptools/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/jaraco/Dropbox/code/main/setuptools/setuptools/command/dist_info.py", line 35, in run
    bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir)
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-2xurzhtb/wheel/bdist_wheel.py", line 443, in egg2dist
    shutil.copy(license, os.path.join(self.distinfo_dir, license_filename))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

In wheel/bdist_wheel:443, self.distinfo_dir is None.

@jaraco
Copy link
Member Author

jaraco commented Nov 12, 2017

I think I only encountered this issue because I happened to be in the setuptools directory. Here's the full steps to replicate:

$ mkdir test-1196
$ cd test-1196
$ touch LICENSE
$ cat > setup.py
import setuptools
setuptools.setup(
name='package',
version='0.0.0',
)

$ cat > setup.cfg
[metadata]
license_file = LICENSE
$ rwt wheel==0.30.0 -- setup.py dist_info
Collecting wheel==0.30.0
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.30.0
running dist_info
creating package.egg-info
writing package.egg-info/PKG-INFO
writing dependency_links to package.egg-info/dependency_links.txt
writing top-level names to package.egg-info/top_level.txt
writing manifest file 'package.egg-info/SOURCES.txt'
reading manifest file 'package.egg-info/SOURCES.txt'
writing manifest file 'package.egg-info/SOURCES.txt'
creating '/Users/jaraco/Dropbox/code/main/setuptools/test-1196/package.dist-info'
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    version='0.0.0',
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/dist_info.py", line 35, in run
    bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir)
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-99p7t7mg/wheel/bdist_wheel.py", line 443, in egg2dist
    shutil.copy(license, os.path.join(self.distinfo_dir, license_filename))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

@pganssle pganssle added Needs Triage Issues that need to be evaluated for severity and status. bug help wanted Needs Investigation Issues which are likely in scope but need investigation to figure out the cause and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Needs Investigation Issues which are likely in scope but need investigation to figure out the cause
Projects
None yet
Development

No branches or pull requests

2 participants