aio-libs / aioftp

ftp client/server for asyncio (http://aioftp.readthedocs.org)
Apache License 2.0
192 stars 54 forks source link

test_get_paths_windows_traverse fails on Python 3.13 #179

Open wRAR opened 1 month ago

wRAR commented 1 month ago
______________________________________________________________________________________________________ test_get_paths_windows_traverse _______________________________________________________________________________________________________

    def test_get_paths_windows_traverse():
        base_path = pathlib.PureWindowsPath("C:\\ftp")
        user = aioftp.User()
        user.base_path = base_path
        connection = aioftp.Connection(current_directory=base_path, user=user)
        virtual_path = pathlib.PurePosixPath("/foo/C:\\windows")
        real_path, resolved_virtual_path = aioftp.Server.get_paths(
            connection,
            virtual_path,
        )
>       assert real_path == base_path
E       AssertionError: assert PureWindowsPath('C:/ftp/foo/C:/windows') == PureWindowsPath('C:/ftp')

Found at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1082132 and I can confirm it locally.

pohmelie commented 1 month ago

I'm not sure how it should work, but it looks like a bug in cpython. Raised one on cpython github: https://github.com/python/cpython/issues/125069

New behaviour looks like what @ported-pw did in https://github.com/aio-libs/aioftp/pull/148.

pohmelie commented 1 month ago

Ok, so this was a bug in a cpython implementation. Bug fixed. Workaround landed. Minimal python version bumped to 3.9. New release is on pypi. Thank you for the report.