bdist_wheel misbehaves on Windows newlines

Open
#1,126 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
build-system

Research direction

Reproduce the issue with setup.py using python setup.py bdist_wheel, then inspect the generated dist/package-0.0.0-py3-none-any.whl/package-0.0.0.dist-info/METADATA and compare it with package.egg-info/PKG-INFO from sdist. The work is done when the Windows wheel preserves both description lines or raises an error for the unsupported newline handling.

Written by the indexing model from the issue text.

Description

bug Needs Investigation Needs Repro

Environment

Python 3.6 64 bits, Windows 10.

>>> setuptools.__version__
'36.2.6'

Steps to reproduce

setup.py

from setuptools import setup
setup(
    name='package',
    version='0.0.0',
    long_description='first line\r\nsecond line',
)
$ python setup.py bdist_wheel
running bdist_wheel
running build
installing to build\bdist.win-amd64\wheel
running install
running install_egg_info
running egg_info
writing package.egg-info\PKG-INFO
writing dependency_links to package.egg-info\dependency_links.txt
writing top-level names to package.egg-info\top_level.txt
reading manifest file 'package.egg-info\SOURCES.txt'
writing manifest file 'package.egg-info\SOURCES.txt'
Copying package.egg-info to build\bdist.win-amd64\wheel\.\package-0.0.0-py3.6.egg-info
running install_scripts
creating build\bdist.win-amd64\wheel\package-0.0.0.dist-info\WHEEL

Observed behavior

dist\package-0.0.0-py3-none-any.whl\package-0.0.0.dist-info\METADATA

Metadata-Version: 2.0
Name: package
Version: 0.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN

first line

Expected behavior

METADATA should include "second line", or an error raised during build.

Notes

python setup.py sdist generates a file with both lines correctly in the description field of PKG-INFO, but they maintain their '\r\n' line endings while the rest of the file uses only \n. This is very unusual and should probably be changed or warned against.

I'm not sure if this issue should be reported here or in https://github.com/pypa/wheel, so apologies if I'm in the wrong place.

Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pypa/setuptools

All issues in pypa/setuptools

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.