Message186041
Function shutil.copy opens source file with open('rb') and destination file with open('wb') and then proceeds to copy the content.
If you create child process from the same python process during that time, that process will inherit open file handles.
This could lead to situation when parent process tries to delete the file, but child process prevents that by holding an open handle to the file (Windows XP, Windows 7).
This is not expected side effect for copy file operation.
Win32's native CopyFile API call doesn't leak file handles to child processes.
Python's open function behavior is defined by platform's implementation, which translates C function fopen with 'rb' and 'wb' modes to CRT open call without O_NOINHERIT flag, which creates inheritable Win32 HANDLEs.
Possible fix would be to add 'N' to mode string in calls to open function in shutil.copy. |
|
Date |
User |
Action |
Args |
2013-04-04 16:23:18 | akrpic77 | set | recipients:
+ akrpic77 |
2013-04-04 16:23:18 | akrpic77 | set | messageid: <1365092598.25.0.167628873092.issue17634@psf.upfronthosting.co.za> |
2013-04-04 16:23:18 | akrpic77 | link | issue17634 messages |
2013-04-04 16:23:17 | akrpic77 | create | |
|