Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hrnciar opened this issue Mar 24, 2023 · 0 comments

Comments

@hrnciar
Copy link

hrnciar commented Mar 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant