Your Environment
-
Your operating system: MacOS
-
Version of python you are running: Probably irrelevant - but 3.9
-
How did you install twine? Did you use your operating system's package manager or pip or something else? Via pip
-
Version of twine you have installed (include complete output of):
venv ❯ twine --version
twine version 4.0.1 (importlib-metadata: 4.6.0, keyring: 23.0.1, pkginfo: 1.8.3, requests: 2.25.1, requests-toolbelt: 0.9.1, urllib3: 1.26.6)
- Which package repository are you targeting? Artifactory in our company
The Issue
When artifactory is configured to hide resources that one doesn't have access to, --skip-existing does not work because Artifactory returns a 404 error instead of 403.
Artifactory docs: https://www.jfrog.com/confluence/display/JFROG/General+Security+Settings#GeneralSecuritySettings-HideExistenceofUnauthorizedResources
Steps to Reproduce
You'll need an appropriately configured artifactory service and a user without delete/overwrite permissions:
INFO Response from https://artifacts.company.com/artifactory/api/pypi/pypi-snapshots:
404 Not Found
INFO {
"errors" : [ {
"status" : 404,
"message" : "Could not locate artifact 'pypi-snapshots:pulumi-helpers/0.0.1.dev0/pulumi_helpers-0.0.1.dev0-py3-none-any.whl'."
} ]
}
ERROR HTTPError: 404 Not Found from https://artifacts.company.com/artifactory/api/pypi/pypi-snapshots
Not Found
I took a look into twine's code and in principle I guess this could easily be fixed by handling this in
On the other hand, 404 errors might be in general be "proper" 404 errors and adding a dedicated cli option seems weird too.
If you have a suggestion about how to handle this, I might find the time to submit a PR.
Your Environment
Your operating system: MacOS
Version of python you are running: Probably irrelevant - but 3.9
How did you install twine? Did you use your operating system's package manager or pip or something else? Via pip
Version of twine you have installed (include complete output of):
The Issue
When artifactory is configured to hide resources that one doesn't have access to, --skip-existing does not work because Artifactory returns a 404 error instead of 403.
Artifactory docs: https://www.jfrog.com/confluence/display/JFROG/General+Security+Settings#GeneralSecuritySettings-HideExistenceofUnauthorizedResources
Steps to Reproduce
You'll need an appropriately configured artifactory service and a user without delete/overwrite permissions:
I took a look into twine's code and in principle I guess this could easily be fixed by handling this in
twine/twine/commands/upload.py
Line 32 in 8f5e5d6
On the other hand, 404 errors might be in general be "proper" 404 errors and adding a dedicated cli option seems weird too.
If you have a suggestion about how to handle this, I might find the time to submit a PR.