Bug 2181985

Summary: python-fs fails to build with Python 3.12: TestReadZipFSMem.test_seek_end fails due to regression in Python 3.12
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-fsAssignee: Parag Nemade <pnemade>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 39CC: mhroncok, pnemade, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:    
Bug Blocks: 2135404    

Description Tomáš Hrnčiar 2023-03-27 07:28:03 UTC
python-fs fails to build with Python 3.12.0a6.
I am opening this for tracking purposes, I've already fixed most of the failures.
TestReadZipFSMem.test_seek_end and TestReadZipFSMem.test_seek_current are failing due to regression in Python 3.12, I've opened upstream issue.

=================================== FAILURES ===================================
________________________ TestReadZipFSMem.test_seek_end ________________________

self = <tests.test_zipfs.TestReadZipFSMem testMethod=test_seek_end>

    def test_seek_end(self):
        with self.fs.openbin("top.txt") as f:
            self.assertEqual(f.tell(), 0)
            self.assertEqual(f.seek(-12, Seek.end), 0)
            self.assertEqual(f.read1(5), b"Hello")
            self.assertEqual(f.seek(-7, Seek.end), 5)
            self.assertEqual(f.seek(-5, Seek.end), 7)
>           self.assertEqual(f.read(), b"World")
E           AssertionError: b'' != b'World'

tests/test_zipfs.py:170: AssertionError
______________________ TestReadZipFSMem.test_seek_current ______________________

self = <tests.test_zipfs.TestReadZipFSMem testMethod=test_seek_current>

    def test_seek_current(self):
        with self.fs.openbin("top.txt") as f:
            self.assertEqual(f.tell(), 0)
            self.assertEqual(f.read(5), b"Hello")
            self.assertEqual(f.tell(), 5)
            self.assertEqual(f.seek(2, Seek.current), 7)
>           self.assertEqual(f.read1(), b"World")
E           AssertionError: b'' != b'World'

tests/test_zipfs.py:156: AssertionError
=========================== short test summary info ============================
--> Regression in Python 3.12
FAILED tests/test_zipfs.py::TestReadZipFSMem::test_seek_end - AssertionError:...
FAILED tests/test_zipfs.py::TestReadZipFSMem::test_seek_current - AssertionEr...

--> Fix proposed to upstream
FAILED tests/test_tempfs.py::TestTempFS::test_remove - AttributeError: 'TestT...
FAILED tests/test_tempfs.py::TestOSFS::test_remove - AttributeError: 'TestOSF...
FAILED tests/test_zipfs.py::TestWriteZipFS::test_remove - AttributeError: 'Te...
FAILED tests/test_appfs.py::TestUserCacheFS::test_remove - AttributeError: 'T...
FAILED tests/test_appfs.py::TestUserConfigFS::test_remove - AttributeError: '...
FAILED tests/test_appfs.py::TestSiteDataFS::test_remove - AttributeError: 'Te...
FAILED tests/test_appfs.py::TestUserLogFS::test_remove - AttributeError: 'Tes...
FAILED tests/test_appfs.py::TestSiteConfigFS::test_remove - AttributeError: '...
FAILED tests/test_appfs.py::TestUserDataFS::test_remove - AttributeError: 'Te...
FAILED tests/test_multifs.py::TestMultiFS::test_remove - AttributeError: 'Tes...
FAILED tests/test_subfs.py::TestSubFS::test_remove - AttributeError: 'TestSub...
FAILED tests/test_subfs.py::TestOSFS::test_remove - AttributeError: 'TestOSFS...
FAILED tests/test_mountfs.py::TestMountFS2::test_remove - AttributeError: 'Te...
FAILED tests/test_mountfs.py::TestMountFS::test_remove - AttributeError: 'Tes...
FAILED tests/test_osfs.py::TestOSFS::test_remove - AttributeError: 'TestOSFS'...
FAILED tests/test_memoryfs.py::TestMemoryFS::test_remove - AttributeError: 'T...
FAILED tests/test_tarfs.py::TestWriteXZippedTarFS::test_remove - AttributeErr...
FAILED tests/test_tarfs.py::TestWriteTarFS::test_remove - AttributeError: 'Te...
FAILED tests/test_tarfs.py::TestWriteBZippedTarFS::test_remove - AttributeErr...
FAILED tests/test_tarfs.py::TestWriteGZippedTarFS::test_remove - AttributeErr...
FAILED tests/test_tarfs.py::TestWriteTarFSToFileobj::test_remove - AttributeE...
=========== 23 failed, 2122 passed, 23 skipped, 7 warnings in 21.98s ===========

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05650779-python-fs/

For all our attempts to build python-fs with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-fs/

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

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 Fedora Release Engineering 2023-08-16 07:12:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.