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

Description not displayed when it contains newlines #201

Closed
bittner opened this issue Oct 1, 2018 · 3 comments
Closed

Description not displayed when it contains newlines #201

bittner opened this issue Oct 1, 2018 · 3 comments

Comments

@bittner
Copy link

bittner commented Oct 1, 2018

Environment

  • OS/distro: Ubuntu 18.04.1 Bionic
  • Python 3.7.0
  • pip 18.0 (python 3.7)
  • twine version 1.12.1 (pkginfo: 1.4.2, requests: 2.19.1, setuptools: 40.4.3, requests-toolbelt: 0.8.0, tqdm: 4.26.0)

Problem Description

When publishing a project, and the description key value contains newlines at the beginning and/or the end then PyPI seems to have trouble to display it.

The fix is using strip() e.g.

setup(
    name=package.name,
    version=package.__version__,
    description=package.__doc__.strip(),
    long_description=read_file('README.md'),
    long_description_content_type='text/markdown',
    ...

Suggested Correction

PyPI and/or the uploading tool should automatically strip the short description key.

Example Project

@bittner
Copy link
Author

bittner commented Oct 1, 2018

This is the very same issue that leads to #202: The tools that generate the PKG-INFO file must ensure that data that is supposed to be a single line of text doesn't contain line breaks.

The correct behavior of those tools should be to abort the processing, requiring the data format or content to be fixed.

@bittner
Copy link
Author

bittner commented Oct 1, 2018

Closing in favor of pypa/setuptools#1390 (duplicate).

@bittner bittner closed this as completed Oct 1, 2018
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