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

Repair Descriptions with newlines and emit a warning #2538

Merged
merged 1 commit into from
Jan 17, 2021

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Jan 17, 2021

Closes #1390

Pull Request Checklist

  • Changes have tests
  • News fragment added

@alexshpilkin
Copy link

Nit: maybe it’d also make sense to str.rstrip() broken descriptions? My guess is that most descriptions with newlines have one at the end. If careless usage of multiline strings (see e.g. PyLops/pyproximal@90d37d0) is frequent enough, it might also make sense to handle newlines and spaces at the beginning as well, and so str.strip() the descriptions instead.

@jaraco
Copy link
Member Author

jaraco commented Jan 17, 2021

Good point, although I do want to be cautious and not overcorrect here. If somehow a space is already present at the beginning or end of the description, I wouldn't want to alter that as part of correcting for newlines, even if that is the correct thing to do. On the other hand, converting a trailing or leading newline to a space seems janky at best.

I think for now I'll stick with this approach, as it still will correct the underlying defect (that metadata gets corrupted) and provide a path forward. I'll defer more sophisticated validation to subsequent efforts (which probably should happen earlier than when writing values out and probably coordinated across multiple forms of input such as setup.py or setup.cfg).

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 this pull request may close these issues.

Newlines in the description field produce a malformed PKG-INFO
2 participants