Message11993
Logged In: YES
user_id=45365
I'm not sure your solution of locking in the file object is feasible. Every call of PyFile_AsFile() is dangerous, if the code proceeds to release the GIL before using the FILE* it's in danger. And this code could be in extension modules too (I know there's quite a few in my own img package).
When I did the universal newlines patch I basically ignored the problem (thinking that no-one in their right mind would close a file in one thread while it's still in use in another: how wrong can one be:-).
The only real solution may be to get rid of PyFile_AsFile altogether, and replace it with PyFile_AsFileLocked() and PyFile_Unlock() and make these calls somehow work even when the GIL is held (possibly by temporarily releasing the GIL while acquiring the file lock). |
|
Date |
User |
Action |
Args |
2007-08-23 14:04:57 | admin | link | issue595601 messages |
2007-08-23 14:04:57 | admin | create | |
|