Skip to content
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

Repository port lost in get_repository_from_config when username is provided #1111

Closed
1 task done
vLabayen opened this issue May 20, 2024 · 0 comments · Fixed by #1112
Closed
1 task done

Repository port lost in get_repository_from_config when username is provided #1111

vLabayen opened this issue May 20, 2024 · 0 comments · Fixed by #1112
Labels

Comments

@vLabayen
Copy link

vLabayen commented May 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

get_repository_from_config, port

What operating system are you using?

Linux

If you selected 'Other', describe your Operating System here

No response

What version of Python are you running?

Python 3.8.10
Python 3.11.9

How did you install twine? Did you use your operating system's package manager or pip or something else?

$ pip install twine

What version of twine do you have installed (include the complete output)

twine version 5.1.0 (importlib-metadata: 7.1.0, keyring: 25.2.1, pkginfo: 1.10.0, requests: 2.31.0, requests-toolbelt: 1.0.0, urllib3: 2.2.1)

Which package repository are you using?

A private one hosted with https://pypi.org/project/pypiserver/, behind an apache server enforcing basicauth.

Please describe the issue that you are experiencing

There is a bug that must have been introduced in 5.1.0 in the repository url parsing.
Concretely, the function get_repository_from_config looses the port information when a username is provided.

The expected behaviour:

>> get_repository_from_config(..., ..., 'https://user:pass@some.domain.com:12345')
{'repository': 'https://some.domain.com:12345', 'username': 'user', 'password': 'pass'}

The current behaviour:

>> get_repository_from_config(..., ..., 'https://user:pass@some.domain.com:12345')
{'repository': 'https://some.domain.com', 'username': 'user', 'password': 'pass'}

Please list the steps required to reproduce this behaviour

Just test the given examples

Anything else you'd like to mention?

No response

@vLabayen vLabayen added the bug label May 20, 2024
sigmavirus24 added a commit that referenced this issue May 21, 2024
When repository URLs were altered to remove user information, we did not
preserve the port. This fixes that by using the better library for
munging the URL and adds tests to ensure no regression.

Closes #1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant