Skip to content

Do not look for a port in a Unix socket domain path - #470

Merged
elprans merged 1 commit into
MagicStack:masterfrom
Lawouach:issue419
Oct 3, 2019
Merged

elprans merged 1 commit into
MagicStack:masterfrom
Lawouach:issue419

Conversation

@Lawouach

@Lawouach Lawouach commented Aug 6, 2019

Copy link
Copy Markdown
Contributor

Contributes to #419

Signed-off-by: Sylvain Hellegouarch sh@defuze.org

@Lawouach

Lawouach commented Aug 9, 2019

Copy link
Copy Markdown
Contributor Author

A gentle nudge, just to see if there is life on this project? :)

Comment thread asyncpg/connect_utils.py Outdated
if hostspec.startswith('/'):
hosts.append(hostspec)
# keep sequence ordering
hostlist_ports.append(5432)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is wrong. Socket paths still have to take the port into consideration. Use port or default_port[i] here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well default_port at that index might not exist, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The length of the default_port list is guaranteed to be the same as the number of specified hosts. See _validate_port_spec

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Simply replace

addr, _, hostspec_port = hostspec.partition(':')

with

if not hostspec.startswith('/'):
    addr, _, hostspec_port = hostspec.partition(':')
else:
    addr = hostspec
    hostspec_port = ''

@Lawouach

Copy link
Copy Markdown
Contributor Author

Happy to squash if that makes the review simpler. Not sure your preferred process.

@elprans

elprans commented Aug 19, 2019

Copy link
Copy Markdown
Member

Please squash. Thanks!

Contributes to MagicStack#419

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
@Lawouach

Copy link
Copy Markdown
Contributor Author

Hi @elprans, I can appreciate you are quite busy but any visibility on a potential new release? Just to plan accordingly :)

@elprans

elprans commented Sep 26, 2019

Copy link
Copy Markdown
Member

Hi @Lawouach, I'll make a release next week.

@Lawouach

Copy link
Copy Markdown
Contributor Author

Woo ooh! Awesome! Thanks.

@elprans
elprans merged commit b773912 into MagicStack:master Oct 3, 2019
@gvbgduh

gvbgduh commented Oct 9, 2019

Copy link
Copy Markdown

fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants