Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/1938.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that reading and writing on the same file may cause race on multiple processes.
5 changes: 4 additions & 1 deletion src/virtualenv/app_data/via_disk_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ def read(self):
except Exception: # noqa
pass
if bad_format:
self.remove()
try:
self.remove()
except OSError: # reading and writing on the same file may cause race on multiple processes
pass
return None

def remove(self):
Expand Down