You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using os.rename() (or pathlib.Path.rename()) can fail on Windows if Briefcase does not have exclusive access to all files in the directory.
A common pattern Briefcase uses is to run shutil.unpack_archive() and rename the unpacked directory; for instance, Android cmdline-tools and Java's JDK. In between these two operations, a background process may acquire a handle on a file; for instance, a Windows file indexer or an antivirus scanner.
Modern Linux file systems are much more resilient to these types of conflicts; so, I would only expect to see this on Windows.
Unfortunately this is a common issue on WIndows, and I don't think there's any workaround except putting all renames and deletions in a retry loop. There are packages such as tenacity which make this easier.
@Deepak6546kumar It's not clear what you're trying to communicate with this code sample. We already had a replication case; what extra information are you providing here?
Describe the bug
Using
os.rename()
(orpathlib.Path.rename()
) can fail on Windows if Briefcase does not have exclusive access to all files in the directory.A common pattern Briefcase uses is to run
shutil.unpack_archive()
and rename the unpacked directory; for instance, Android cmdline-tools and Java's JDK. In between these two operations, a background process may acquire a handle on a file; for instance, a Windows file indexer or an antivirus scanner.Modern Linux file systems are much more resilient to these types of conflicts; so, I would only expect to see this on Windows.
Steps to reproduce
Expected behavior
Renaming these directories in the Briefcase cache should be successful.
Screenshots
No response
Environment
0.3.18
Logs
No response
Additional context
Origin: beeware/beeware#348
The text was updated successfully, but these errors were encountered: