Closed TinfoilSubmarine closed 6 months ago
This is due to socket.inet_ntop
returning different values on different systems. I just tested on glibc and musl Linux, as well as Windows, and can confirm that inet_ntop
is to "blame" for this.
Oh yeah it's gonna be 100% that. Short-term I'm happy to accept a PR that makes the test pass conditionally on musl by expecting the other value, although it's not clear to me how one would detect musl.
Long-term I think netaddr should make it possible to produce a stable text representation and an implementation-dependent one (which one by default – not sure at this stage).
What does this return on your machine @TinfoilSubmarine?
python -c 'import platform; print(platform.libc_ver())'
What does this return on your machine @TinfoilSubmarine?
python -c 'import platform; print(platform.libc_ver())'
$ python -c 'import platform; print(platform.libc_ver())'
('libc', '')
Thank you. One more question, do you mind installing packaging
and providing the output of python -c 'from packaging.tags import sys_tags; print(list(sys_tags()))'
? I'm trying to figure out the best way to make this test conditional.
Thank you. One more question, do you mind installing
packaging
and providing the output ofpython -c 'from packaging.tags import sys_tags; print(list(sys_tags()))'
? I'm trying to figure out the best way to make this test conditional.
$ python -c 'from packaging.tags import sys_tags; print(list(sys_tags()))'
[<cp312-cp312-musllinux_1_1_x86_64 @ 139937041473344>, <cp312-cp312-musllinux_1_0_x86_64 @ 139937041566976>, <cp312-cp312-linux_x86_64 @ 139937041567104>, <cp312-abi3-musllinux_1_1_x86_64 @ 139937041567488>, <cp312-abi3-musllinux_1_0_x86_64 @ 139937041567424>, <cp312-abi3-linux_x86_64 @ 139937041567296>, <cp312-none-musllinux_1_1_x86_64 @ 139937041567744>, <cp312-none-musllinux_1_0_x86_64 @ 139937041567616>, <cp312-none-linux_x86_64 @ 139937041567872>, <cp311-abi3-musllinux_1_1_x86_64 @ 139937043503744>, <cp311-abi3-musllinux_1_0_x86_64 @ 139937041568064>, <cp311-abi3-linux_x86_64 @ 139937041568192>, <cp310-abi3-musllinux_1_1_x86_64 @ 139937041568320>, <cp310-abi3-musllinux_1_0_x86_64 @ 139937041568448>, <cp310-abi3-linux_x86_64 @ 139937041568576>, <cp39-abi3-musllinux_1_1_x86_64 @ 139937041568704>, <cp39-abi3-musllinux_1_0_x86_64 @ 139937041568832>, <cp39-abi3-linux_x86_64 @ 139937041568960>, <cp38-abi3-musllinux_1_1_x86_64 @ 139937041569088>, <cp38-abi3-musllinux_1_0_x86_64 @ 139937041569216>, <cp38-abi3-linux_x86_64 @ 139937041569344>, <cp37-abi3-musllinux_1_1_x86_64 @ 139937041569472>, <cp37-abi3-musllinux_1_0_x86_64 @ 139937041569600>, <cp37-abi3-linux_x86_64 @ 139937041569728>, <cp36-abi3-musllinux_1_1_x86_64 @ 139937041569856>, <cp36-abi3-musllinux_1_0_x86_64 @ 139937041569984>, <cp36-abi3-linux_x86_64 @ 139937041570112>, <cp35-abi3-musllinux_1_1_x86_64 @ 139937041570240>, <cp35-abi3-musllinux_1_0_x86_64 @ 139937041570368>, <cp35-abi3-linux_x86_64 @ 139937041570496>, <cp34-abi3-musllinux_1_1_x86_64 @ 139937041570624>, <cp34-abi3-musllinux_1_0_x86_64 @ 139937041570752>, <cp34-abi3-linux_x86_64 @ 139937041570880>, <cp33-abi3-musllinux_1_1_x86_64 @ 139937041571008>, <cp33-abi3-musllinux_1_0_x86_64 @ 139937041571136>, <cp33-abi3-linux_x86_64 @ 139937041571264>, <cp32-abi3-musllinux_1_1_x86_64 @ 139937041571392>, <cp32-abi3-musllinux_1_0_x86_64 @ 139937041571520>, <cp32-abi3-linux_x86_64 @ 139937041571648>, <py312-none-musllinux_1_1_x86_64 @ 139937041473920>, <py312-none-musllinux_1_0_x86_64 @ 139937041571968>, <py312-none-linux_x86_64 @ 139937041572096>, <py3-none-musllinux_1_1_x86_64 @ 139937041572224>, <py3-none-musllinux_1_0_x86_64 @ 139937041572352>, <py3-none-linux_x86_64 @ 139937041572480>, <py311-none-musllinux_1_1_x86_64 @ 139937041572608>, <py311-none-musllinux_1_0_x86_64 @ 139937041572736>, <py311-none-linux_x86_64 @ 139937041572864>, <py310-none-musllinux_1_1_x86_64 @ 139937041572992>, <py310-none-musllinux_1_0_x86_64 @ 139937041573120>, <py310-none-linux_x86_64 @ 139937041573248>, <py39-none-musllinux_1_1_x86_64 @ 139937041573376>, <py39-none-musllinux_1_0_x86_64 @ 139937041573504>, <py39-none-linux_x86_64 @ 139937041573632>, <py38-none-musllinux_1_1_x86_64 @ 139937041573760>, <py38-none-musllinux_1_0_x86_64 @ 139937041573888>, <py38-none-linux_x86_64 @ 139937041574016>, <py37-none-musllinux_1_1_x86_64 @ 139937041574144>, <py37-none-musllinux_1_0_x86_64 @ 139937041574272>, <py37-none-linux_x86_64 @ 139937041574400>, <py36-none-musllinux_1_1_x86_64 @ 139937041574528>, <py36-none-musllinux_1_0_x86_64 @ 139937041574656>, <py36-none-linux_x86_64 @ 139937041574784>, <py35-none-musllinux_1_1_x86_64 @ 139937041574912>, <py35-none-musllinux_1_0_x86_64 @ 139937041575040>, <py35-none-linux_x86_64 @ 139937041575168>, <py34-none-musllinux_1_1_x86_64 @ 139937041575296>, <py34-none-musllinux_1_0_x86_64 @ 139937041575424>, <py34-none-linux_x86_64 @ 139937041575552>, <py33-none-musllinux_1_1_x86_64 @ 139937041575680>, <py33-none-musllinux_1_0_x86_64 @ 139937041575808>, <py33-none-linux_x86_64 @ 139937041575936>, <py32-none-musllinux_1_1_x86_64 @ 139937041576064>, <py32-none-musllinux_1_0_x86_64 @ 139937041576192>, <py32-none-linux_x86_64 @ 139937041576320>, <py31-none-musllinux_1_1_x86_64 @ 139937041576448>, <py31-none-musllinux_1_0_x86_64 @ 139937041576576>, <py31-none-linux_x86_64 @ 139937041576704>, <py30-none-musllinux_1_1_x86_64 @ 139937041576832>, <py30-none-musllinux_1_0_x86_64 @ 139937041576960>, <py30-none-linux_x86_64 @ 139937041577088>, <cp312-none-any @ 139937041577216>, <py312-none-any @ 139937041577280>, <py3-none-any @ 139937041577344>, <py311-none-any @ 139937041577408>, <py310-none-any @ 139937041577472>, <py39-none-any @ 139937041577536>, <py38-none-any @ 139937041577600>, <py37-none-any @ 139937041577664>, <py36-none-any @ 139937041577728>, <py35-none-any @ 139937041577792>, <py34-none-any @ 139937041577856>, <py33-none-any @ 139937041577920>, <py32-none-any @ 139937041577984>, <py31-none-any @ 139937041578048>, <py30-none-any @ 139937041578112>]
The fix for this has been released in netaddr 1.3.0.
Looks similar to https://github.com/netaddr/netaddr/blob/master/netaddr/tests/strategy/test_ipv6_strategy.py#L142-L148