Skip to content

test_seek_end and test_seek_current fails due to regression in Python 3.12.0a1+. #569

Open
@hrnciar

Description

@hrnciar

While building pyfilesystem2 with development versions of Python 3.12 I discovered a regression in CPython. You can find details and reproducer here.

=================================== 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

FAILED tests/test_zipfs.py::TestReadZipFSMem::test_seek_end - AssertionError:...
FAILED tests/test_zipfs.py::TestReadZipFSMem::test_seek_current - AssertionEr...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions