Skip to content

Conversation

@RafaelJohn9
Copy link

@RafaelJohn9 RafaelJohn9 commented Feb 1, 2025

Signed-off-by: RafaelJohn9 <[email protected]>
@ghost
Copy link

ghost commented Feb 1, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 1, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@RafaelJohn9 RafaelJohn9 requested a review from donBarbos February 1, 2025 13:22
@RafaelJohn9
Copy link
Author

RafaelJohn9 commented Feb 1, 2025

With this change introduced which addresses issue #129548, it seems to affect other tests where this behavior is not expected

======================================================================
FAIL: test_no_mask (test.test_ipaddress.InterfaceTestCase_v6.test_no_mask)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 731, in test_no_mask
    self.assertEqual(str(scoped_net), '::1%scope/128')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '::1/128' != '::1%scope/128'
- ::1/128
+ ::1%scope/128


======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=4)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_pickle (test.test_ipaddress.InterfaceTestCase_v6.test_pickle) (proto=5)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 94, in pickle_test
    self.assertEqual(y, x)
    ~~~~~~~~~~~~~~~~^^^^^^
AssertionError: IPv6Interface('2001:db8::1000/128') != IPv6Interface('2001:db8::1000/128')

======================================================================
FAIL: test_valid_netmask (test.test_ipaddress.InterfaceTestCase_v6.test_valid_netmask)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 778, in test_valid_netmask
    self.assertEqual(str(self.factory('2001:db8::%scope/32')), '2001:db8::%scope/32')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '2001:db8::/32' != '2001:db8::%scope/32'
- 2001:db8::/32
+ 2001:db8::%scope/32
?           ++++++


======================================================================
FAIL: testEqual (test.test_ipaddress.IpaddrUnitTest.testEqual)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 1723, in testEqual
    self.assertFalse(self.ipv6_scoped_interface ==
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ipaddress.IPv6Interface('2001:658:22a:cafe:200::1/64'))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True is not false

======================================================================
FAIL: testGetScopeId (test.test_ipaddress.IpaddrUnitTest.testGetScopeId)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 1358, in testGetScopeId
    self.assertEqual(str(self.ipv6_scoped_address.scope_id),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     'scope')
                     ^^^^^^^^
AssertionError: 'None' != 'scope'
- None
+ scope


======================================================================
FAIL: testInterfaceComparison (test.test_ipaddress.IpaddrUnitTest.testInterfaceComparison)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 2034, in testInterfaceComparison
    self.assertFalse(ipaddress.ip_interface('::1%scope/64') ==
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    ipaddress.ip_interface('::1/64'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True is not false

======================================================================
FAIL: testNotEqual (test.test_ipaddress.IpaddrUnitTest.testNotEqual)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 1772, in testNotEqual
    self.assertTrue(self.ipv6_scoped_interface !=
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ipaddress.IPv6Interface('2001:658:22a:cafe:200::1/64'))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

======================================================================
FAIL: testRepr (test.test_ipaddress.IpaddrUnitTest.testRepr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 1097, in testRepr
    self.assertEqual("IPv6Interface('::1%scope/128')",
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     repr(ipaddress.IPv6Interface('::1%scope')))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "IPv6Interface('::1%scope/128')" != "IPv6Interface('::1/128')"
- IPv6Interface('::1%scope/128')
?                   ------
+ IPv6Interface('::1/128')


======================================================================
FAIL: testSlash128Constructor (test.test_ipaddress.IpaddrUnitTest.testSlash128Constructor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ipaddress.py", line 1795, in testSlash128Constructor
    self.assertEqual(str(ipaddress.IPv6Interface('::1%scope/128')),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                              '::1%scope/128')
                              ^^^^^^^^^^^^^^^^
AssertionError: '::1/128' != '::1%scope/128'
- ::1/128
+ ::1%scope/128

am conflicted about introducing the change in those tests/methods in favor of this change as they may or may not be in the scope of the issue.

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

…9ERy9.rst


Update: Reduce lines in **News.d**

Co-authored-by: Semyon Moroz <[email protected]>
@donBarbos
Copy link
Contributor

donBarbos commented Apr 18, 2025

@RafaelJohn9 could you also merge main branch?

EDIT: and re-sign the Contributor License Agreement

@RafaelJohn9
Copy link
Author

okay 👍

@donBarbos
Copy link
Contributor

I don't think it's possible to accept this PR without passing all the tests

@RafaelJohn9
Copy link
Author

@donBarbos

sure thing, did leave a comment above.

@picnixz

This comment was marked as outdated.

@picnixz picnixz closed this Sep 9, 2025
@picnixz picnixz reopened this Sep 10, 2025
@picnixz
Copy link
Member

picnixz commented Sep 10, 2025

Sorry but I will revisit my decision. I think this is a legitimate bug because the with_* properties lose the scope ID. See also #129538 (comment). We should properly fix the handling of the scope ID for interfaces. As for networks, I don't really know because the RFC is too vague about it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants