RuntimeError when call os.remove during os.scandir
RuntimeError when call os.remove during os.scandir: a task in swe-rebench-v2.1-rl-isolated-1k: SWE-rebench V2.1 RL, isolated grading (1k subset) (Harbor dataset). def test file removed during scandir(fs): fs.create file('/wls/1.log') fs.create file('/wls/2.log') with os.scandir('/wls') as it: for…
The task
def test_file_removed_during_scandir(fs): fs.create_file('/wls/1.log') fs.create_file('/wls/2.log') with os.scandir('/wls') as it: for entry in it: if entry.is_file(): os.remove(entry.path) assert not os.path.exists('/wls/1.log') ```