Bug 2259547 - python-pathvalidate fails to build with Python 3.13: pathvalidate.error.ValidationError: reason=MALFORMED_ABS_PATH, target-platform=Windows, description=an invalid absolute file path (/a/b/c.txt) for the platform (Windows). to avoid the error, specify an
Summary: python-pathvalidate fails to build with Python 3.13: pathvalidate.error.Valid...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pathvalidate
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonny Heggheim
QA Contact:
URL:
Whiteboard:
: 2291834 (view as bug list)
Depends On:
Blocks: F41FTBFS F41FailsToInstall PYTHON3.13 2291514 2297253
TreeView+ depends on / blocked
 
Reported: 2024-01-22 10:02 UTC by Karolina Surma
Modified: 2024-08-16 17:40 UTC (History)
5 users (show)

Fixed In Version: python-pathvalidate-3.2.0-5.fc41
Clone Of:
Environment:
Last Closed: 2024-08-13 07:36:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github thombashi pathvalidate issues 39 0 None open Unit tests fails with Python 3.13.0 alpha 3 2024-01-22 11:20:08 UTC

Description Karolina Surma 2024-01-22 10:02:48 UTC
python-pathvalidate fails to build with Python 3.13.03.

________ Test_validate_filepath.test_abs_path[windows-/a/b/c.txt-None] _________

self = <test.test_filepath.Test_validate_filepath object at 0x7fd18f5ba150>
test_platform = 'windows', value = '/a/b/c.txt', expected = None

    @pytest.mark.parametrize(
        ["test_platform", "value", "expected"],
        [
            ["linux", "/a/b/c.txt", None],
            ["linux", "C:\\a\\b\\c.txt", ValidationError],
            ["windows", "/a/b/c.txt", None],
            ["windows", "C:\\a\\b\\c.txt", None],
            ["universal", "/a/b/c.txt", ValidationError],
            ["universal", "C:\\a\\b\\c.txt", ValidationError],
        ],
    )
    def test_abs_path(self, test_platform, value, expected):
        if expected is None:
>           validate_filepath(value, platform=test_platform)

test/test_filepath.py:232: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pathvalidate/_filepath.py:344: in validate_filepath
    ).validate(file_path)
pathvalidate/_filepath.py:186: in validate
    self.validate_abspath(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pathvalidate._filepath.FilePathValidator object at 0x7fd18eb39730>
value = '/a/b/c.txt'

    def validate_abspath(self, value: PathType) -> None:
        value = str(value)
        is_posix_abs = posixpath.isabs(value)
        is_nt_abs = ntpath.isabs(value)
        err_object = ValidationError(
            description=(
                "an invalid absolute file path ({}) for the platform ({}).".format(
                    value, self.platform.value
                )
                + " to avoid the error, specify an appropriate platform correspond"
                + " with the path format, or 'auto'."
            ),
            platform=self.platform,
            reason=ErrorReason.MALFORMED_ABS_PATH,
        )
    
        if any([self._is_windows() and is_nt_abs, self._is_linux() and is_posix_abs]):
            return
    
        if self._is_universal() and any([is_posix_abs, is_nt_abs]):
            ValidationError(
                description=(
                    "{}. expected a platform independent file path".format(
                        "POSIX absolute file path found"
                        if is_posix_abs
                        else "NT absolute file path found"
                    )
                ),
                platform=self.platform,
                reason=ErrorReason.MALFORMED_ABS_PATH,
            )
    
        if any([self._is_windows(), self._is_universal()]) and is_posix_abs:
>           raise err_object
E           pathvalidate.error.ValidationError: reason=MALFORMED_ABS_PATH, target-platform=Windows, description=an invalid absolute file path (/a/b/c.txt) for the platform (Windows). to avoid the error, specify an appropriate platform correspond with the path format, or 'auto'.

=========================== short test summary info ============================
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[windows-\\-ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[windows-\\ -ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[windows-\\xyz-ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[windows-\\xyz -ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[universal-\\-ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[universal-\\ -ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[universal-\\xyz-ValidationError]
FAILED test/test_filename.py::Test_validate_filename::test_win_abs_path[universal-\\xyz -ValidationError]
FAILED test/test_filepath.py::Test_validate_filepath::test_abs_path[windows-/a/b/c.txt-None]
============ 9 failed, 3415 passed, 18 skipped, 4 warnings in 3.07s ============


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06934919-python-pathvalidate/

For all our attempts to build python-pathvalidate with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-pathvalidate/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Jonny Heggheim 2024-01-22 11:13:39 UTC
Updated to latest version 3.2.0 for rawhide, but the tests still fail.

Comment 2 Jonny Heggheim 2024-01-22 11:20:09 UTC
Reported issue upstream

Comment 3 Aoife Moloney 2024-02-15 23:11:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 4 Karolina Surma 2024-06-12 15:05:12 UTC
*** Bug 2291834 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Fails To Install 2024-06-19 19:58:23 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 6 Fedora Fails To Install 2024-07-13 07:59:52 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 4+ weeks.
This is the second reminder (step 4) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 7 Sandro 2024-07-27 10:54:40 UTC
Would it make sense to have the Windows tests pass? It appears the `os.path.isabs()` change in 3.13 only affects Windows platforms. If so, I have a patch to allow the tests to pass in a backwards compatible fashion.

Comment 8 Fedora Fails To Install 2024-08-13 00:02:00 UTC
This package has been orphaned.

You can pick it up at https://src.fedoraproject.org/rpms/python-pathvalidate by clicking button "Take". If nobody picks it up, it will be retired and removed from a distribution.

Comment 9 Fedora Update System 2024-08-13 07:32:15 UTC
FEDORA-2024-5442309d80 (python-pathvalidate-3.2.0-5.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-5442309d80

Comment 10 Fedora Update System 2024-08-13 07:36:06 UTC
FEDORA-2024-5442309d80 (python-pathvalidate-3.2.0-5.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Jonny Heggheim 2024-08-16 15:22:05 UTC
Thanks for picking it up, sorry for my slow responses.

Comment 12 Sandro 2024-08-16 16:00:11 UTC
No worries. It's a runtime dependency for one of mine. I kinda had to. I'd be happy to add you back as a co-maintainer, if you like.

Comment 13 Jonny Heggheim 2024-08-16 16:33:52 UTC
Would appreciate if you adding me as co-maintainer. FAS: jonny

Comment 14 Sandro 2024-08-16 17:40:08 UTC
Done. I haven't made any changes to the package, other than applying the patch. One thing I probably will do once there's a need for working on the package again, is conversion to rpmautospec.


Note You need to log in before you can comment on or make changes to this bug.