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

[BUG] NameError on deprecation warning in 58.4.0 #2846

Closed
1 task done
austinweisgrau opened this issue Nov 2, 2021 · 3 comments
Closed
1 task done

[BUG] NameError on deprecation warning in 58.4.0 #2846

austinweisgrau opened this issue Nov 2, 2021 · 3 comments
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@austinweisgrau
Copy link

setuptools version

58.4.0

Python version

Python 3.6

OS

Ubuntu 18.04

Additional environment information

No response

Description

A version conflict resulted in setuptools attempting to raise a class that no longer exists in 58.4.0, resulting in a crash.

Expected behavior

The class name should be called appropriately so that a NameError isn't raised

How to Reproduce

In particular, this happened when trying to launch gunicorn.

Output

Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: Traceback (most recent call last):
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 573, in _build_master
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     ws.require(__requires__)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 891, in require
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     needed = self.resolve(parse_requirements(requirements))
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 782, in resolve
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     raise VersionConflict(dist, req).with_context(dependent_req)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: pkg_resources.VersionConflict: (gunicorn 19.10.0 (/home/ubuntu/.local/lib/python3.6/site-packages), Requirement.parse('gunicorn==19.7.1'))
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: During handling of the above exception, another exception occurred:
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: Traceback (most recent call last):
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 114, in parse_version
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     return packaging.version.Version(v)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/version.py", line 277, in __init__
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     raise InvalidVersion("Invalid version: '{0}'".format(version))
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.18ubuntu0.18.04.1'
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: During handling of the above exception, another exception occurred:
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: Traceback (most recent call last):
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/usr/bin/gunicorn3", line 6, in <module>
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     from pkg_resources import load_entry_point
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3247, in <module>
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     @_call_aside
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3231, in _call_aside
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     f(*args, **kwargs)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3260, in _initialize_master_working_set
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     working_set = WorkingSet._build_master()
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 575, in _build_master
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     return cls._build_from_requirements(__requires__)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     dists = ws.resolve(reqs, Environment())
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 975, in __init__
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     self.scan(search_path)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1008, in scan
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     self.add(dist)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1028, in add
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2604, in hashcmp
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     self.parsed_version,
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2651, in parsed_version
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     self._parsed_version = parse_version(self.version)
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 119, in parse_version
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]:     PkgResourcesDeprecationWarning,
Nov 02 20:03:22 ip-172-31-23-12 gunicorn3[9718]: NameError: name 'PkgResourcesDeprecationWarning' is not defined

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@austinweisgrau austinweisgrau added bug Needs Triage Issues that need to be evaluated for severity and status. labels Nov 2, 2021
@jaraco
Copy link
Member

jaraco commented Nov 3, 2021

Thanks for the report. Yes, that definitely sounds like a bug.

@jaraco
Copy link
Member

jaraco commented Nov 3, 2021

That class does still exist. I think the issue is that the warning gets raised before the parser gets to processing the definition of the warning class in the module.

@jaraco jaraco closed this as completed in 30f070e Nov 3, 2021
@jaraco
Copy link
Member

jaraco commented Nov 3, 2021

Presumed fix releasing as v58.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

2 participants