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: module 'warnings' has no attribute 'UserWarning' when installing package with multi-line description #2539

Closed
greschd opened this issue Jan 17, 2021 · 3 comments

Comments

@greschd
Copy link

greschd commented Jan 17, 2021

When installing a package with a multi-line description with the latest setuptools version (51.3.2), I get the following error:

      File "/home/greschd/.virtualenvs/tmp-9b3743628834a12/lib/python3.8/site-packages/setuptools/dist.py", line 125, in single_line
        warnings.UserWarning("newlines not allowed and will break in the future")
    AttributeError: module 'warnings' has no attribute 'UserWarning'

This seems to be related to the discussion in #1390, and specifically the change in #2538, because UserWarning is a built-in global, not part of the warnings module:

>>> import warnings
>>> warnings.UserWarning
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'warnings' has no attribute 'UserWarning'
>>> UserWarning
<class 'UserWarning'>
>>> 

The fix should be very straightforward, using warnings.warn instead.

@jaraco
Copy link
Member

jaraco commented Jan 17, 2021

Yeah, that was dumb. My mistake for not testing it at all. I'll push out a fix right away.

@jaraco jaraco closed this as completed in 49364a9 Jan 17, 2021
@jaraco
Copy link
Member

jaraco commented Jan 17, 2021

Should be fixed in v51.3.3.

@greschd
Copy link
Author

greschd commented Jan 17, 2021

Thanks for the quick response, and all the good work on setuptools! 🚀

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

No branches or pull requests

2 participants