Bug 2181985 - python-fs fails to build with Python 3.12: TestReadZipFSMem.test_seek_end fails due to regression in Python 3.12
Summary: python-fs fails to build with Python 3.12: TestReadZipFSMem.test_seek_end fai...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-fs
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Parag Nemade
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-03-27 07:28 UTC by Tomáš Hrnčiar
Modified: 2023-08-16 07:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-fs pull-request 4 0 None None None 2023-03-27 07:28:03 UTC
Github PyFilesystem pyfilesystem2 issues 568 0 None open Python 3.12 removed a number of TestCase method aliases which breaks the tests 2023-03-27 07:28:03 UTC
Github PyFilesystem pyfilesystem2 issues 569 0 None open test_seek_end and test_seek_current fails due to regression in Python 3.12.0a1+. 2023-03-27 07:28:03 UTC
Github PyFilesystem pyfilesystem2 pull 570 0 None open Replace TestCase method aliases removed in Python 3.12 2023-03-27 07:28:03 UTC
Github python cpython issues 102956 0 None open Regression in zipfile, read1(-1) after seek() returns empty byte string 2023-03-27 07:28:03 UTC

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.


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