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

bintree: use urllib provided attributes for hostname, user and password #1230

Closed
wants to merge 1 commit into from

Conversation

parona-source
Copy link
Contributor

@parona-source parona-source commented Jan 5, 2024

In addition to simplifying it also solves an issue with parsing raw ipv6 addresses.

Bug: https://bugs.gentoo.org/921400

>>> test = urlparse("ssh://[::1]/var/cache/binpkgs")
>>> test.netloc
'[::1]'
>>> test.hostname
'::1'
>>> test = urlparse("ssh://[::1]:23/var/cache/binpkgs")
>>> test.netloc
'[::1]:23'
>>> test.hostname
'::1'
>>> test = urlparse("ssh://test@[fe80::1ff:fe23:4567:890a]:23/var/cache/binpkgs")
>>> test.netloc
'test@[fe80::1ff:fe23:4567:890a]:23'
>>> test.hostname
'fe80::1ff:fe23:4567:890a'
>>> test.port
23
>>> test = urlparse("ssh://test:password@[fe80::1ff:fe23:4567:890a]:23/var/cache/binpkgs")
>>> test.netloc
'test:password@[fe80::1ff:fe23:4567:890a]:23'
>>> test.hostname
'fe80::1ff:fe23:4567:890a'
>>> test.port
23
>>> test.username
'test'
>>> test.password
'password'

In addition to simplifying it also solves an issue with parsing raw
ipv6 addresses.

Bug: https://bugs.gentoo.org/921400
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I've no clue why it was done like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants