question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setuptools (39.1.0) doesn't set up Description-Content-Type correctly on Windows

See original GitHub issue

Originally reported in pypa/warehouse#4341.

It looks like long_description is full of Windows-style carriage-return characters (^M) which seem to have confused twine/pkginfo about what is and what isn’t part of long_description.

My project at PyPI is at: https://pypi.org/project/gff3tool/1.4.2.

Libraries used:

wheel==0.31.1
setuptools==39.1.0
twine==1.11.0

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mathamcommented, Dec 30, 2019

I’ve also had a similar issue when trying to upload a sdist to PyPI that was rejected and twine check said:

Checking dist/Kivy-2.0.0rc1.tar.gz: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 1: Severe: Unexpected section title or transition.

    ====
  warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.

Even though we did set long_description_content_type='text/markdown'. However, I could only reproduce it when the sdist was generated on GitHub Action on a Windows CI instance, not locally.

Specifically, we set the long description by doing:

with open(join(dirname(__file__), 'README.md'), 'rb') as fileh:
    long_description = fileh.read().decode("utf8")

But the generated Windows CI generated sdist (with python setup.py sdist --formats=gztar) created a sdist whose PKG-INFO was malformed. Specifically, it’s Description field containing the description replaced all the \r\n in the original description with \r\r\n.

Changing our long_description to fileh.read().decode("utf8").replace('\r\n', '\n') fixed the issue.

1reaction
dicommented, Nov 16, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

long_description_content_type=text/markdown doesn't always ...
I have setuptools 39.0.1, twine 1.11.0, and wheel 0.31.0, and I ran python setup.py sdist upload . I even deleted ConceptNet ...
Read more >
Why do I have Description-Content-Type: UNKNOWN
It is available in the Core Metadata v2.1. You can use this metadata in you setup.py to specify the content type of your...
Read more >
setuptools 3.0.1 - PyPI
Easily download, build, install, upgrade, and uninstall Python packages.
Read more >
How to Setup Your Python Environment for Machine Learning ...
3. Start and Update Anaconda · 1. Open a terminal (command line window). · 2. Confirm conda is installed correctly, by typing: 1....
Read more >
setuptools Changelog - pyup.io
Instead, projects are encouraged to properly configure ``packages`` or use ... <https://packaging.python.org/specifications/#description-content-type>`_
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found