Skip to content

PathName2URLTests fail with Python 3.12.9 #647

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

Open
ptrcnull opened this issue Mar 30, 2025 · 1 comment
Open

PathName2URLTests fail with Python 3.12.9 #647

ptrcnull opened this issue Mar 30, 2025 · 1 comment

Comments

@ptrcnull
Copy link

some changes between Python 3.12.2 and 3.12.9 cause the following tests to fail on Alpine Linux edge with python-future 1.0.0:

____________ URL2PathNameTests.test_converting_when_no_drive_letter ____________

self = <test_future.test_urllib.URL2PathNameTests testMethod=test_converting_when_no_drive_letter>

    def test_converting_when_no_drive_letter(self):
        # cannot end a raw string in \
>       self.assertEqual(url2pathname("///C/test/"), r'\\\C\test' '\\')
E       AssertionError: '\\C\\test\\' != '\\\\\\C\\test\\'
E       - \C\test\
E       + \\\C\test\
E       ? ++

tests/test_future/test_urllib.py:1339: AssertionError
________________ URL2PathNameTests.test_roundtrip_url2pathname _________________

self = <test_future.test_urllib.URL2PathNameTests testMethod=test_roundtrip_url2pathname>

    def test_roundtrip_url2pathname(self):
        list_of_paths = ['C:',
                         r'\\\C\test\\',
                         r'C:\foo\bar\spam.foo'
                         ]
        for path in list_of_paths:
>           self.assertEqual(url2pathname(pathname2url(path)), path)
E           AssertionError: '\\C\\test\\\\' != '\\\\\\C\\test\\\\'
E           - \C\test\\
E           + \\\C\test\\
E           ? ++

tests/test_future/test_urllib.py:1355: AssertionError
________________ PathName2URLTests.test_converting_drive_letter ________________

self = <test_future.test_urllib.PathName2URLTests testMethod=test_converting_drive_letter>

    def test_converting_drive_letter(self):
        self.assertEqual(pathname2url("C:"), '///C:')
>       self.assertEqual(pathname2url("C:\\"), '///C:')
E       AssertionError: '///C:/' != '///C:'
E       - ///C:/
E       ?      -
E       + ///C:

tests/test_future/test_urllib.py:1361: AssertionError
____________ PathName2URLTests.test_converting_when_no_drive_letter ____________

self = <test_future.test_urllib.PathName2URLTests testMethod=test_converting_when_no_drive_letter>

    def test_converting_when_no_drive_letter(self):
>       self.assertEqual(pathname2url(r"\\\folder\test" "\\"),
                         '/////folder/test/')
E       AssertionError: '///folder/test/' != '/////folder/test/'
E       - ///folder/test/
E       + /////folder/test/
E       ? ++

tests/test_future/test_urllib.py:1364: AssertionError
________________ PathName2URLTests.test_roundtrip_pathname2url _________________

self = <test_future.test_urllib.PathName2URLTests testMethod=test_roundtrip_pathname2url>

    def test_roundtrip_pathname2url(self):
        list_of_paths = ['///C:',
                         '/////folder/test/',
                         '///C:/foo/bar/spam.foo']
        for path in list_of_paths:
>           self.assertEqual(pathname2url(url2pathname(path)), path)
E           AssertionError: '//folder/test/' != '/////folder/test/'
E           - //folder/test/
E           + /////folder/test/
E           ? +++

tests/test_future/test_urllib.py:1383: AssertionError
____________ URL2PathNameTests.test_converting_when_no_drive_letter ____________

self = <test_future.test_urllib_toplevel.URL2PathNameTests testMethod=test_converting_when_no_drive_letter>

    def test_converting_when_no_drive_letter(self):
        # cannot end a raw string in \
>       self.assertEqual(url2pathname("///C/test/"), r'\\\C\test' '\\')
E       AssertionError: '\\C\\test\\' != '\\\\\\C\\test\\'
E       - \C\test\
E       + \\\C\test\
E       ? ++

tests/test_future/test_urllib_toplevel.py:1357: AssertionError
________________ URL2PathNameTests.test_roundtrip_url2pathname _________________

self = <test_future.test_urllib_toplevel.URL2PathNameTests testMethod=test_roundtrip_url2pathname>

    def test_roundtrip_url2pathname(self):
        list_of_paths = ['C:',
                         r'\\\C\test\\',
                         r'C:\foo\bar\spam.foo'
                         ]
        for path in list_of_paths:
>           self.assertEqual(url2pathname(pathname2url(path)), path)
E           AssertionError: '\\C\\test\\\\' != '\\\\\\C\\test\\\\'
E           - \C\test\\
E           + \\\C\test\\
E           ? ++

tests/test_future/test_urllib_toplevel.py:1373: AssertionError
________________ PathName2URLTests.test_converting_drive_letter ________________

self = <test_future.test_urllib_toplevel.PathName2URLTests testMethod=test_converting_drive_letter>

    def test_converting_drive_letter(self):
        self.assertEqual(pathname2url("C:"), '///C:')
>       self.assertEqual(pathname2url("C:\\"), '///C:')
E       AssertionError: '///C:/' != '///C:'
E       - ///C:/
E       ?      -
E       + ///C:

tests/test_future/test_urllib_toplevel.py:1379: AssertionError
____________ PathName2URLTests.test_converting_when_no_drive_letter ____________

self = <test_future.test_urllib_toplevel.PathName2URLTests testMethod=test_converting_when_no_drive_letter>

    def test_converting_when_no_drive_letter(self):
>       self.assertEqual(pathname2url(r"\\\folder\test" "\\"),
                         '/////folder/test/')
E       AssertionError: '///folder/test/' != '/////folder/test/'
E       - ///folder/test/
E       + /////folder/test/
E       ? ++

tests/test_future/test_urllib_toplevel.py:1382: AssertionError
________________ PathName2URLTests.test_roundtrip_pathname2url _________________

self = <test_future.test_urllib_toplevel.PathName2URLTests testMethod=test_roundtrip_pathname2url>

    def test_roundtrip_pathname2url(self):
        list_of_paths = ['///C:',
                         '/////folder/test/',
                         '///C:/foo/bar/spam.foo']
        for path in list_of_paths:
>           self.assertEqual(pathname2url(url2pathname(path)), path)
E           AssertionError: '//folder/test/' != '/////folder/test/'
E           - //folder/test/
E           + /////folder/test/
E           ? +++

tests/test_future/test_urllib_toplevel.py:1401: AssertionError
@ptrcnull
Copy link
Author

seems to be caused by this change: python/cpython#127217

algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 22, 2025
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

No branches or pull requests

1 participant