-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
400 response, no error message #1809
Comments
Something like: response = self.client.post(
self.repo,
data=data,
files={'content': (artifact.name, f, 'application/octet-stream')},
auth=(self.user, self.auth),
)
import httpx
try:
response.raise_for_status()
except httpx.HTTPStatusError as exc:
exc.args = (exc.args[0], f"{response.text}")
raise exc In the <html>
<head>
<title>400 This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse for more information.</title>
</head>
<body>
<h1>400 This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse for more information.</h1>
The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse for more information.
</body>
</html> I am up for contributing a fix, if you're interested in this. |
Thank you for debugging! I don't quite understand what the error means, can you please explain? |
I am trying to upload a version name that pypi has already recorded before, and is not a valid upload, but this is just my specific case. These error messages could be useful for all users of hatch. Lmk what you think about the proposed change : ) |
Oh, so that error happens when you try to upload an artifact that already exists? I thought I accounted for that case https://github.com/pypa/hatch/blob/hatch-v1.13.0/src/hatch/publish/index.py#L117 |
That check does not trigger for some reason. But this error message is more general, could be applied for any unaccounted errors like in this case. At least, the users see what's wrong with their config. Now it's a black box: |
Yes please feel free to open a PR! I'm just confused about why this particular issue is happening. |
The problem reappears with the latest release of
hatchling
. I would really appreciatehatch
giving some human-readable feedback about the issue rather than status codes of http requests...The text was updated successfully, but these errors were encountered: