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

AttributeError for --user installs when platsubdir is None #86

Closed
asottile opened this issue Dec 22, 2021 · 4 comments · Fixed by #87
Closed

AttributeError for --user installs when platsubdir is None #86

asottile opened this issue Dec 22, 2021 · 4 comments · Fixed by #87

Comments

@asottile
Copy link
Contributor

see reproduction in #85 (comment)

broken by this patch: eba2bcd

@FFY00 FFY00 closed this as completed in #87 Dec 22, 2021
@jaraco jaraco changed the title --user installs broken with setuptools 60.0.4 AttributeError for --user installs when platsubdir is None Dec 23, 2021
@jaraco
Copy link
Member

jaraco commented Dec 23, 2021

The test suite did test that getconfigvar('platsubdir') would reliably resolve to a string or None. What neither the Setuptools suite nor the Distutils suite tested was that a None value would be expected to have string interfaces (and not simply have a string representation).

@jaraco
Copy link
Member

jaraco commented Dec 23, 2021

Traceback is:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xjd_2vnp/astpretty_165bf4578d4043dea2cf66e37deae34b/setup.py", line 2, in <module>
        setup()
      File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 148, in setup
        return run_commands(dist)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
        dist.run_commands()
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/local/lib/python3.8/dist-packages/setuptools/command/install.py", line 45, in finalize_options
        orig.install.finalize_options(self)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/command/install.py", line 429, in finalize_options
        self.create_home_path()
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/command/install.py", line 639, in create_home_path
        if path.startswith(home) and not os.path.isdir(path):
    AttributeError: 'NoneType' object has no attribute 'startswith'

@asottile
Copy link
Contributor Author

@jaraco the thing is the testsuite did fail, but it was pushed directly to main and ignored

@jaraco
Copy link
Member

jaraco commented Dec 23, 2021

Yep. My mistake. Acknowledged in #90. Long term, the solution will be for these tests to be part of the Setuptools test suite and part of the integrated release process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants