Message187903
| Author |
neologix |
| Recipients |
arigo, neologix, pitrou |
| Date |
2013年04月27日.12:41:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1367066495.25.0.276013150217.issue17852@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Code relying on garbage collection/shutdown hook to flush files is borked:
- it's never been guaranteed by the Python specification (neither does Java/C#...)
- even with an implementation based on C stdio streams, streams won't get flushed in case of _exit()/abort()/asynchronous signal
Furthermore, I think it's inherently unsafe: in a multi-threaded program, flushing requires locking, and doing this at shutdown is a recipe for deadlock/arbitrary delay (image you have a daemon thread currently holding the lock, e.g. for stdout).
In short, that's an application bug to me. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年04月27日 12:41:35 | neologix | set | recipients:
+ neologix, arigo, pitrou |
| 2013年04月27日 12:41:35 | neologix | set | messageid: <1367066495.25.0.276013150217.issue17852@psf.upfronthosting.co.za> |
| 2013年04月27日 12:41:35 | neologix | link | issue17852 messages |
| 2013年04月27日 12:41:34 | neologix | create |
|