Skip to content
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

Python 3.13 test failure: test_ip_address_ipv6_ipv4_mapped #582

Open
suve opened this issue Jul 31, 2024 · 7 comments
Open

Python 3.13 test failure: test_ip_address_ipv6_ipv4_mapped #582

suve opened this issue Jul 31, 2024 · 7 comments
Labels
bug Something isn't working ready-to-ship

Comments

@suve
Copy link

suve commented Jul 31, 2024

In Fedora Rawhide (the development branch / "eternal alpha" version) we've recently updated to Python 3.13.0b4 pre-release. With this new version, the following test failure can be observed:

FAIL: test_ip_address_ipv6_ipv4_mapped (tests.test_ip_address.MyTests.test_ip_address_ipv6_ipv4_mapped)
Test ipv6 address with ipv4 mapped string
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/jc-1.25.3-build/jc-1.25.3/tests/test_ip_address.py", line 95, in test_ip_address_ipv6_ipv4_mapped
    self.assertEqual(jc.parsers.ip_address.parse(data, quiet=True), expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'ver[45 chars]ffff:192.168.1.35', 'ip_compressed': '::ffff:1[2371 chars]11'}} != {'ver[45 chars]ffff:c0a8:123', 'ip_compressed': '::ffff:c0a8:[2336 chars]11'}}
  {'bin': {'broadcast': '00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000101010000000000100100011',
           'first_host': '00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000101010000000000100100011',
           'hostmask': '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
           'ip': '00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000101010000000000100100011',
           'last_host': '00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000101010000000000100100011',
           'netmask': '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111',
           'network': '00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000101010000000000100100011'},
-  'broadcast': '::ffff:192.168.1.35',
?                        - ------- -

+  'broadcast': '::ffff:c0a8:123',
?                       +++++

   'cidr_netmask': 128,
-  'dns_ptr': '5.3...1...8.6.1...2.9.1.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
?              --  ^   ^   ^ ^ ^^^^^^^

+  'dns_ptr': '3.2.1.0.8.a.0.c.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
?                ^   ^   ^ ^ ^

-  'first_host': '::ffff:192.168.1.35',
?                         - ------- -

+  'first_host': '::ffff:c0a8:123',
?                        +++++

   'hex': {'broadcast': '00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23',
           'first_host': '00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23',
           'hostmask': '00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00',
           'ip': '00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23',
           'last_host': '00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23',
           'netmask': 'ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff',
           'network': '00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23'},
   'hostmask': '::',
   'hosts': 1,
   'int': {'broadcast': 281473913979171,
           'first_host': 281473913979171,
           'ip': 281473913979171,
           'last_host': 281473913979171,
           'network': 281473913979171},
-  'ip': '::ffff:192.168.1.35',
+  'ip': '::ffff:c0a8:123',
-  'ip_compressed': '::ffff:192.168.1.35',
?                            - ------- -

+  'ip_compressed': '::ffff:c0a8:123',
?                           +++++

-  'ip_exploded': '0000:0000:0000:0000:0000:ffff:192.168.1.35',
?                                                 - ------- -

+  'ip_exploded': '0000:0000:0000:0000:0000:ffff:c0a8:0123',
?                                                ++++++

-  'ip_split': ['0000', '0000', '0000', '0000', '0000', 'ffff', '192.168.1.35'],
?                                                                 - ------- -

+  'ip_split': ['0000', '0000', '0000', '0000', '0000', 'ffff', 'c0a8', '0123'],
?                                                                +++++++++

   'ipv4_mapped': '192.168.1.35',
   'is_global': False,
   'is_link_local': False,
   'is_loopback': False,
   'is_multicast': False,
   'is_private': True,
   'is_reserved': True,
   'is_unspecified': False,
-  'last_host': '::ffff:192.168.1.35',
?                        - ------- -

+  'last_host': '::ffff:c0a8:123',
?                       +++++

   'max_prefix_length': 128,
   'netmask': 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
-  'network': '::ffff:192.168.1.35',
?                      - ------- -

+  'network': '::ffff:c0a8:123',
?                     +++++

   'scope_id': None,
   'six_to_four': None,
   'teredo_client': None,
   'teredo_server': None,
   'version': 6}

----------------------------------------------------------------------

I'm fully aware that Python 3.13.0b4 is a pre-release, which makes testing difficult, so this issue will probably have to wait until the final 3.13.0 release. You can consider this a heads-up. ;-)

For reference, the Python 3.13 "what's new" page currently lists the following changes:

ipaddress

Sorry for not contributing a fix, but my Python knowledge doesn't really extend past FizzBuzz level.

@kellyjonbrazil
Copy link
Owner

kellyjonbrazil commented Jul 31, 2024

Hi there - thanks for reporting this. I believe this is a duplicate of #572 and will be fixed in the next release.

Edit: unless this is a new issue from 3.13 we need to address? It looks like the other issue fixed a change in 6to4 addresses but this is affecting mapped addresses. Will have to investigate.

@kellyjonbrazil kellyjonbrazil added duplicate This issue or pull request already exists bug Something isn't working and removed duplicate This issue or pull request already exists labels Jul 31, 2024
@suve
Copy link
Author

suve commented Aug 1, 2024

I think this is a new issue. It affects a different test, and applying the patch from PR #573 does not help.

@kellyjonbrazil
Copy link
Owner

Looks like this is caused by:

python/cpython#87799

python/cpython#29345

@kellyjonbrazil
Copy link
Owner

kellyjonbrazil commented Aug 2, 2024

I'm working on a fix, but have opened a cpython issue that I think might need to be addressed as well: python/cpython#123409

@kellyjonbrazil
Copy link
Owner

python/cpython#123409 is in process of being patched: python/cpython#123419

@kellyjonbrazil
Copy link
Owner

It looks like the CPython issue has been addressed and will be fixed in the next 3.13 release. I have committed some changes that should fix this issue and tests when the latest Python release comes out.

71af0c5

@suve
Copy link
Author

suve commented Nov 1, 2024

So, now that Python 3.13 is out - jc v1.25.3 builds fine and all tests pass, provided one backports the following two commits: 9eb4df3 and 71af0c5.

As such, this issue should be fixed for everyone in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-ship
Projects
None yet
Development

No branches or pull requests

2 participants