-
Notifications
You must be signed in to change notification settings - Fork 309
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
Upload to Gitlab fails because twine checks against a localized string message #993
Comments
Because pypi.org (and it's predecessors) as well as the other non-PyPI indexes we barely support use 400 with a variety of messages about the error itself. There's no way to handle every possible localization - to your point. But also, we can't provide @bhrutledge I'm beginning to think |
Thanks for the rationale, it makes sense. I'm wondering what is triggering the translation of the message since the request is the same in both cases. |
I have no clue what would cause the difference honestly. We don't send anything related to your locale in the request so even if the container was inheriting something from the system, I wouldn't know what to point you to. |
FYI this is the issue on the gitlab side: https://gitlab.com/gitlab-org/gitlab/-/issues/410698 |
Just FYI, the issue on gitlab side was closed after being stale for a year. That means twine is compatible with Gitlab but can't be used in any language but english. Unless someone knows Gitlab code and can make a PR, this can be closed since there's nothing else to do |
Your Environment
Thank you for taking the time to report an issue.
To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.
Your operating system: Ubuntu 22.04 LTS
Version of python you are running:
If you're having issues uploading a specific package, you must include a copy of the following:
PKG-INFO
file.pypirc
file (REMOVE ALL USERNAMES & PASSWORDS BEFORE UPLOADING)The Issue
Passing
--skip-existing
totwine upload
works correctly on my pc and the program prints a warning and exits with a 0 return code.The exact same command run in gitlab CI fails the entire job and the program prints an error and exits with a non-zero return code.
This is because gitlab returns a localized message in the response, and the locale is different between the two environments: in the CI the error message returned is this:
Which fails this check, because the string is compared directly:
Is there a reason why the response message string is checked directly instead of using the status code? A simple
status == 400
would work.(Note: the commands are run inside the same docker image, one on my pc and one in the CI, so I can be reasonably sure there are no confounding factors)
Steps to Reproduce
If the issue is predictable and consistently reproducible, please list the steps here.
The text was updated successfully, but these errors were encountered: