Skip to content

Is it possible to support ipaddress.IPv4Interface in the /codecs/network.pyx #497

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

Closed
mauriciodtdt opened this issue Nov 8, 2019 · 1 comment · Fixed by #499
Closed

Comments

@mauriciodtdt
Copy link

mauriciodtdt commented Nov 8, 2019

Currently the library just allows to insert ipaddress.IPv4Address and ipaddress.IPv4Networks to a postgresdb.
When I tried to insert an ipaddress.IPv4Interface, I got following error:

E ValueError: '10.0.0.1/30' does not appear to be an IPv4 or IPv6 address

Cheers

  • asyncpg version:0.19.0
  • PostgreSQL version: 9.6.11
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version:3.7
  • Platform:
  • Do you use pgbouncer?:
  • Did you install asyncpg with pip?:
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    :
elprans added a commit that referenced this issue Nov 10, 2019
Currently we treat values with network prefix in `inet` values
as `IPvXNetwork`, instead of `IPvXInterface` which is wrong.

Fixes: #497
@elprans
Copy link
Member

elprans commented Nov 10, 2019

This looks to me like a bug. inet columns should be treated as ip_interface values, not ip_network. #499 fixes this. Thanks for spotting!

@1st1 1st1 closed this as completed in #499 Nov 19, 2019
1st1 pushed a commit that referenced this issue Nov 19, 2019
Currently we treat values with network prefix in `inet` values
as `IPvXNetwork`, instead of `IPvXInterface` which is wrong.

Fixes: #497
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 a pull request may close this issue.

2 participants