Windows: rmdirRecursive() fails if a contained file is opened
|Reported by:||dl||Owned by:|
rmdirRecursive() for runtime.platformType == 'win32' assumes (and requires), that after a successful os.remove(file_path) no file with path file_path exists (as long as it is not recreated by an other process). In fact, this is not guaranteed on Windows: http://www.osronline.com/article.cfm?article=245.
In our environment, rmdirRecursive() in the context of a SVN checkout ("clobber") quite often failed (about every third time), probably due to files temporarily opened by the installed antivirus suite: exceptions.WindowsError?: [Error 145] Das Verzeichnis ist nicht leer.
The only solution I could find, is to try several times after some seconds of waiting, ignoring this errors at every try except the last one.
Change History (17)
comment:1 Changed 3 years ago by dl
- Cc dl.metrohm@… added
- Summary changed from Windows: rmdirRecursive() fails if a contained files is opened to Windows: rmdirRecursive() fails if a contained file is opened