[issue26716] EINTR handling in fcntl

2016-04-17 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file42498/fcntl_eintr-3.patch ___ Python tracker ___

[issue26716] EINTR handling in fcntl

2016-04-17 Thread STINNER Victor
STINNER Victor added the comment: I updated the test, does it look better now? -- ___ Python tracker ___ ___

[issue26716] EINTR handling in fcntl

2016-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Left nitpicks about tests. -- ___ Python tracker ___ ___ Python-bugs-list

[issue26716] EINTR handling in fcntl

2016-04-15 Thread STINNER Victor
STINNER Victor added the comment: Patch version 2: * add a comment to explain the C loop retrying on EINTR error * add an unit test: I checked that the test fails with InterruptedError without the fix * document the change in fcntl documentation -- Added file:

[issue26716] EINTR handling in fcntl

2016-04-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9ffe055f2b0e by Serhiy Storchaka in branch '3.5': Issue #26716: Regenerate Argument Clinic code. https://hg.python.org/cpython/rev/9ffe055f2b0e New changeset 19dec08e54a8 by Serhiy Storchaka in branch 'default': Issues #26716, #26057: Regenerate

[issue26716] EINTR handling in fcntl

2016-04-12 Thread STINNER Victor
STINNER Victor added the comment: Ok, I will update the patch to include an unit test and only apply it to Python 3.5. -- ___ Python tracker ___

[issue26716] EINTR handling in fcntl

2016-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just don't know whether the patch will break existing code that relies on current behavior. If EINTR handling in other functions was not backported to older versions, I think this is good argument against fixing this issue in 3.5. Could you write tests

[issue26716] EINTR handling in fcntl

2016-04-12 Thread STINNER Victor
STINNER Victor added the comment: > I think it would be nice to publish somewhere (on ActoveState receipts, on > StackOverflow) well-searchable correct example. Yeah, it's always possible to enhance the doc. I'm not an user of ActiveState or StackOverflow websites. Don't hesitate to submit a

[issue26716] EINTR handling in fcntl

2016-04-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The signal handler doesn't raise an exception in the example on StackOverflow. [1] I think it would be nice to publish somewhere (on ActoveState receipts, on StackOverflow) well-searchable correct example. [1]

[issue26716] EINTR handling in fcntl

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > It looks to me that interrupting fcntl can be used for implementing blocking lock with a timeout. If automatically retry fcntl() on EINTR, this will break such code. If the signal handler doesn't raise an exception, the

[issue26716] EINTR handling in fcntl

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that interrupting fcntl can be used for implementing blocking lock with a timeout. If automatically retry fcntl() on EINTR, this will break such code. -- ___ Python tracker

[issue26716] EINTR handling in fcntl

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: Oh, we forgot the fcntl module in the PEP 475. Here is a fix for Python 3.5 (and 3.6). -- keywords: +patch nosy: +serhiy.storchaka Added file: http://bugs.python.org/file42409/fcntl_eintr.patch ___ Python tracker

[issue26716] EINTR handling in fcntl

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 60ac28b612af by Victor Stinner in branch '3.5': Update fcntl doc: replace IOError with OSError https://hg.python.org/cpython/rev/60ac28b612af -- nosy: +python-dev ___ Python tracker

[issue26716] EINTR handling in fcntl

2016-04-08 Thread SilentGhost
Changes by SilentGhost : -- components: +Extension Modules nosy: +haypo, neologix, twouters versions: +Python 3.6 ___ Python tracker

[issue26716] EINTR handling in fcntl

2016-04-08 Thread Jack Zhou
New submission from Jack Zhou: According to PEP 475, standard library modules should handle EINTR, but this appears to not be the case for the fcntl module. Test script: import fcntl import signal import os def handle_alarm(signum, frame): print("Received alarm in process