Skip to content

Conversation

@frenzymadness
Copy link

I've managed to update this module to the version we currently have in CPython 3.8. The fix for #55 proposed in #56 is also included.

As I explained in #59, some changes might be a little bit backward-incompatible but not in a sense of compatibility with older Pythons but some parts just get deleted in CPython. I haven't seen anything important.

I had to do some small details in different ways or skip a commit or a part of it, here are some notes from the process:

All tests are okay locally (in Docker containers) so they should be okay also in the CI. Reviews and tests appreciated.

…GH-6016)

The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.
Stop rejecting IPv4 octets with leading zeroes as ambiguously octal.

Plenty of other tools generate decimal IPv4 octets with leading zeroes,
so keeping this check hurts interoperability.

Patch by Joel Croteau.
IPv4Interface and IPv6Interface did not has netmask and hostmask
attributes when its argument is bytes or int.

This commit extracts method for constructors of Network and Interface,
and ensure Interface class always provides them.
The __hash__() methods of classes IPv4Interface and IPv6Interface had issue
of generating constant hash values of 32 and 128 respectively causing hash collisions.
The fix uses the hash() function to generate hash values for the objects
instead of XOR operation

Fixes: phihag#55
@shadchin
Copy link

@phihag Can you merge this PR?

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.

2 participants