#35699: DatabaseOperations raise ValueError for valid GenericIPAddressField 
(inet)
value with psycopg3
-------------------------------------+-------------------------------------
     Reporter:  florianvazelle       |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:                       |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
  psycopg3,GenericIPAddressField     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 I move recently to psycopg3, and it's seems that the {{{Inet}}} class
 change to be an alias of {{{ipaddress.ip_address}}} in
 
[https://github.com/django/django/blob/main/django/db/backends/postgresql/psycopg_any.py#L12].
 But some valid inet value raise an {{{ValueError}}}, such as:


 {{{
 >>> import ipaddress
 >>> ipaddress.ip_address("192.168.1/24")
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/florian/.pyenv/versions/3.11.9/lib/python3.11/ipaddress.py",
 line 54, in ip_address
     raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6
 address')
 ValueError: '192.168.1/24' does not appear to be an IPv4 or IPv6 address
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35699>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701917955e44c-9ca854df-4d05-49be-b96b-be47485cf44c-000000%40eu-central-1.amazonses.com.

Reply via email to