question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omitting trailing slash on some PEP 503 repositories prevents inferring the correct upload URL

See original GitHub issue
  • Poetry version: 1.2.1
  • Python version: 3.8.10
  • OS version and name: Linux Mint 20.3 Una
  • pyproject.toml: not applicable
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below. (not applicable)

Issue

Apologies for reporting essentially two issues at once, but trying to figure out the first led directly into the second for me.

The first is the same basic issue reported in #3600, now in 1.2.1 - configuring poetry config repositories.testpypi https://test.pypi.org/legacy without the trailing slash caused silent failures.

The thing is, I get silent failures this way even when using twine (or poetry run twine, as described in Issue #742) to upload instead would succeed. The only symptom is that the package does not appear on TestPyPI.

Second issue: after adding the trailing slash and trying again, I got noisy failures instead -

$ poetry config repositories.testpypi https://test.pypi.org/legacy/
$ poetry config pypi-token.testpypi <api token omitted>
$ poetry publish -r testpypi

Publishing <package name omitted> to testpypi
 - Uploading <file name omitted> FAILED

HTTP Error 403: Invalid or non-existent authentication information. See https://
test.pypi.org/help/#invalid-auth for more information. | b'<html>\n <head>\n  <t
itle>403 Invalid or non-existent authentication information. See https://test.py
pi.org/help/#invalid-auth for more information.\n \n <body>\n  <h1>403 Invalid o
r non-existent authentication information. See https://test.pypi.org/help/#inval
id-auth for more information.\n  Access was denied to this resource.<br/><br/>\n
Invalid or non-existent authentication information. See https://test.pypi.org/he
lp/#invalid-auth for more information.\n\n\n \n'

As far as I can tell, poetry config pypi-token.testpypi <API token> doesn’t actually do anything, despite everything I can find in the documentation and third-party guides. There is no update to the content of ~/.config/pypoetry/config.toml, and I get the error shown above when trying to use poetry publish. (If it is supposed to write information somewhere else, I have no idea how to verify that.) It seems I am forced to specify my actual username and password explicitly on the command line. Even setting the username to __token__ and password to the API token value, as described in PyPI’s help, does not seem to work.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
neersightedcommented, Oct 3, 2022

Issue #3600 is closed and you have a reproduction here – I am keeping this open to track the trailing slash normalization enhancement.

0reactions
zahlmancommented, Oct 3, 2022

Looks good. I guess there is nothing more here besides what is in issue #3600, and the rest was ultimately my oversight, so I consider the matter resolved now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

540634 – Removing the trailing slash on https urls can ... - Bugs
The underlying issue is a poorly configured Nexus server. If you hit the repo url without a trailing slash, it redirects to a...
Read more >
CHANGES.rst · apertis/v2022dev2 · pkg / python-setuptools · GitLab
#1671: Fixed issue with the PEP 517 backend that prevented building a wheel when the dist/ directory contained existing .whl files.
Read more >
Should You Have a Trailing Slash at the End of URLs? - Ahrefs
A trailing slash is a forward slash (“/”) placed at the end of a URL such as domain.com/ or domain.com/page/. But should you...
Read more >
Changelog - pip documentation v22.3.1
Correctly allow PEP 517 projects to be detected without warnings in pip freeze . (#10080). Strip leading slash from a file:// URL built...
Read more >
avocado Documentation - Avocado Framework
Avocado comes with a sysinfo plugin, which automatically gathers some ... Avocado modules are available on standard Fedora repos starting with version 29....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found