This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年08月27日 09:33 by xZise, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| ipaddr.patch | xZise, 2014年08月27日 13:06 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg225950 - (view) | Author: Fabian (xZise) * | Date: 2014年08月27日 09:33 | |
The ipaddress module accepts IPv6 addresses if the IPv4 address is formatted as an octal number, but http://tools.ietf.org/html/rfc3986#section-3.2.2 doesn't allow leading zeroes in the IPv4 address. This is the current behaviour (in 3.4.1): >>> ipaddress.ip_address("::1.0.0.00") IPv6Address('::100:0') Expected: >>> ipaddress.ip_address("::1.0.0.00") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "3.4.1/lib/python3.4/ipaddress.py", line 54, in ip_address address) ValueError: '::1.0.0.00' does not appear to be an IPv4 or IPv6 address Because I didn't know it better, I first tried to patch the backport but this might be still applicable the official code: https://github.com/phihag/ipaddress/pull/12 |
|||
| msg225983 - (view) | Author: Fabian (xZise) * | Date: 2014年08月27日 13:06 | |
The patch adds an optional keyword which only accepts decimal numbers. |
|||
| msg408058 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年12月09日 00:24 | |
This is what I get now on 3.11:
>>> ipaddress.ip_address("::1.0.0.00")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\User\src\cpython\Lib\ipaddress.py", line 54, in ip_address
raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: '::1.0.0.00' does not appear to be an IPv4 or IPv6 address
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:07 | admin | set | github: 66478 |
| 2021年12月09日 00:24:12 | iritkatriel | set | status: open -> closed nosy: + iritkatriel messages: + msg408058 resolution: fixed stage: resolved |
| 2021年04月11日 23:00:33 | Julian | set | nosy:
+ Julian |
| 2014年08月29日 01:33:52 | berker.peksag | set | nosy:
+ ncoghlan, pitrou, pmoody |
| 2014年08月27日 13:06:02 | xZise | set | files:
+ ipaddr.patch keywords: + patch messages: + msg225983 |
| 2014年08月27日 09:33:26 | xZise | create | |