Closed
Description
Describe the bug
Trying to upload a wheel with file name that has .
replaced with _
in the dist name, results in an error:
λ twine upload dist/* --verbose
Uploading distributions to https://upload.pypi.org/legacy/
dist\simplepackage_py-1.0.0-py2.py3-none-any.whl (1.1 KB)
dist\simplepackage.py-1.0.0.tar.gz (0.5 KB)
username set from keyring
password set from keyring
username: jack1142
password: <hidden>
Uploading simplepackage_py-1.0.0-py2.py3-none-any.whl
100%|█████████████████████████████████████████████████████████████████████████████| 3.70k/3.70k [00:01<00:00, 3.18kB/s]
Content received from server:
<html>
<head>
<title>400 Start filename for 'simplepackage.py' with 'simplepackage.py'.</title>
</head>
<body>
<h1>400 Start filename for 'simplepackage.py' with 'simplepackage.py'.</h1>
The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
Start filename for 'simplepackage.py' with 'simplepackage.py'.
</body>
</html>
HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Start filename for 'simplepackage.py' with 'simplepackage.py'.
Expected behavior
I expected PyPI to accept a wheel file named simplepackage_py-1.0.0-py2.py3-none-any.whl
for a package named simplepackage.py
per the wheel spec
To Reproduce
git clone https://github.com/jack1142/simplepackage.py
cd simplepackage.py
python -m pip install -U build twine
python -m build
twine upload dist/*
My Platform
build==0.6.0.post1
twine==3.4.2
flit==3.3.0
Additional context
I first thought this is an issue with flit but then I was pointed out to the wheel spec and told that this should be fixed in warehouse:
pypa/flit#442