Bug 2325197

Summary: python-commoncode fails to build with Python 3.14: tarfile.SpecialFileError: '6-FIFOTYPE' is a special file
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-commoncodeAssignee: Robert-André Mauchin 🐧 <eclipseo>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 43CC: asmahapatra, eclipseo, ksurma, maxwell, mhroncok, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-commoncode-32.2.1-4.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-08-27 21:30:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2372144, 2372189    
Bug Blocks: 2322407    

Description Karolina Surma 2024-11-11 14:11:22 UTC
python-commoncode fails to build with Python 3.14.0a1.

=================================== FAILURES ===================================
____________________________ TypeTest.test_get_type ____________________________

self = <test_filetype.TypeTest testMethod=test_get_type>

    def test_get_type(self):
>       test_dir = self.extract_test_tar('filetype/types.tar', verbatim=True)

tests/test_filetype.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/commoncode/testcase.py:216: in extract_test_tar
    return self.__extract(test_path, extract_tar, verbatim)
src/commoncode/testcase.py:206: in __extract
    extract_func(original_archive, target_dir, verbatim=verbatim)
src/commoncode/archive.py:61: in extract_tar
    tar.extractall(target_dir, members=to_extract)
/usr/lib64/python3.14/tarfile.py:2319: in extractall
    tarinfo = self._get_extract_tarinfo(member, filter_function, path)
/usr/lib64/python3.14/tarfile.py:2373: in _get_extract_tarinfo
    self._handle_fatal_error(e)
/usr/lib64/python3.14/tarfile.py:2371: in _get_extract_tarinfo
    tarinfo = filter_function(tarinfo, path)
/usr/lib64/python3.14/tarfile.py:830: in data_filter
    new_attrs = _get_filtered_attrs(member, dest_path, True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

member = <TarInfo '6-FIFOTYPE' at 0x7ff6c5cd16c0>
dest_path = '/tmp/scancode-tk-tests -iao0iuss/cb0wz6jy/types.tar'
for_data = True

    def _get_filtered_attrs(member, dest_path, for_data=True):
        new_attrs = {}
        name = member.name
        dest_path = os.path.realpath(dest_path)
        # Strip leading / (tar's directory separator) from filenames.
        # Include os.sep (target OS directory separator) as well.
        if name.startswith(('/', os.sep)):
            name = new_attrs['name'] = member.path.lstrip('/' + os.sep)
        if os.path.isabs(name):
            # Path is absolute even after stripping.
            # For example, 'C:/foo' on Windows.
            raise AbsolutePathError(member)
        # Ensure we stay in the destination
        target_path = os.path.realpath(os.path.join(dest_path, name))
        if os.path.commonpath([target_path, dest_path]) != dest_path:
            raise OutsideDestinationError(member, target_path)
        # Limit permissions (no high bits, and go-w)
        mode = member.mode
        if mode is not None:
            # Strip high bits & group/other write bits
            mode = mode & 0o755
            if for_data:
                # For data, handle permissions & file types
                if member.isreg() or member.islnk():
                    if not mode & 0o100:
                        # Clear executable bits if not executable by user
                        mode &= ~0o111
                    # Ensure owner can read & write
                    mode |= 0o600
                elif member.isdir() or member.issym():
                    # Ignore mode for directories & symlinks
                    mode = None
                else:
                    # Reject special files
>                   raise SpecialFileError(member)
E                   tarfile.SpecialFileError: '6-FIFOTYPE' is a special file

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08189196-python-commoncode/

For all our attempts to build python-commoncode with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-commoncode/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Aoife Moloney 2025-02-26 13:15:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 2 Maxwell G 2025-06-11 01:48:33 UTC
Filed https://github.com/aboutcode-org/commoncode/issues/88. I'll disable the test downstream for now.

Comment 3 Ayan 2025-10-23 12:28:53 UTC
Hi, I've also resolved this upstream at https://github.com/aboutcode-org/commoncode/issues/88, thanks for reporting this. We also have a release there with https://github.com/aboutcode-org/commoncode/releases/tag/v32.4.0 adding python 3.14 support.
I was also wondering if we could run some of the CI tests also on a fedora distro directly upstream on a github actions, since this is a fedora package now too.