Message125863
> 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. |
|
Date |
User |
Action |
Args |
2011-01-09 20:59:29 | pitrou | set | recipients:
+ pitrou, georg.brandl, neologix, alanwilter |
2011-01-09 20:59:24 | pitrou | link | issue9504 messages |
2011-01-09 20:59:24 | pitrou | create | |
|