Message125863
| Author |
pitrou |
| Recipients |
alanwilter, georg.brandl, neologix, pitrou |
| Date |
2011年01月09日.20:59:24 |
| SpamBayes Score |
3.1741276e-13 |
| Marked as misclassified |
No |
| Message-id |
<1294606761.3700.3.camel@localhost.localdomain> |
| In-reply-to |
<AANLkTikt6Dc9xw4HVWYE4ew7jSivJUMoUc14uVgroBvW@mail.gmail.com> |
| Content |
> Attached is a tentative patch: it checks for pending signals inside
> _bufferedreader_read_generic, fileio_readall, and rawiobase_readall.
> I tested quickly on regular files and on pipes, and handlers are now
> called on time. As a an obvious bonus, it's also easier to interrupt a
> script doing I/O with a KeyboardInterrupt (SIGINT).
> If nothing seems blatantly wrong about this patch, I will go ahead and
> try to write some tests for this.
A potential downside is that the bytes which have been read simply get
lost. But since a signal can happen at any moment I guess nothing can be
done to protect from it in the general case, anyway.
As for the tests, the SignalsTest class in test_io.py is a natural
recipient. |
|