Open
Description
On Python3.12 (python:3.12-alpine)
import shutil
from unittest.mock import patch
from pyfakefs.fake_filesystem import FakeFilesystem
from pyfakefs.fake_os import FakeOsModule
fake_fs = FakeFilesystem()
os_mock = FakeOsModule(fake_fs)
for _ in range(10):
print(id(os_mock.lstat))
with patch("shutil.os", os_mock):
shutil.rmtree("/foo")
prints (sometimes) different ids and raised
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/local/lib/python3.12/shutil.py", line 759, in rmtree
_rmtree_safe_fd(stack, onexc)
File "/usr/local/lib/python3.12/shutil.py", line 667, in _rmtree_safe_fd
assert func is os.lstat
^^^^^^^^^^^^^^^^
AssertionError
I don't understand what this is related to, why different id's are returned for class
Metadata
Metadata
Assignees
Labels
No labels