python / cpython

The Python programming language
https://www.python.org
Other
62.72k stars 30.07k forks source link

Improve clarity of signal.siginterrupt docs #69745

Open a4eb36e5-6759-47bf-8e24-1aa4d349c6ed opened 8 years ago

a4eb36e5-6759-47bf-8e24-1aa4d349c6ed commented 8 years ago
BPO 25559
Nosy @vstinner, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['type-feature', 'docs'] title = 'signal.siginterrupt description has typo' updated_at = user = 'https://bugs.python.org/TomMeagher' ``` bugs.python.org fields: ```python activity = actor = 'vstinner' assignee = 'docs@python' closed = False closed_date = None closer = None components = ['Documentation'] creation = creator = 'Tom Meagher' dependencies = [] files = [] hgrepos = [] issue_num = 25559 keywords = [] message_count = 3.0 messages = ['254121', '254132', '254140'] nosy_count = 4.0 nosy_names = ['vstinner', 'r.david.murray', 'docs@python', 'Tom Meagher'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue25559' versions = [] ```

a4eb36e5-6759-47bf-8e24-1aa4d349c6ed commented 8 years ago

"if flag is False, system calls will be restarted when interrupted by signal signalnum, otherwise system calls will be interrupted."

This sentence doesn't make any sense as written. I assume there should be a "not" in there somewhere, but I'm unclear if signal calls are not interrupted when the flag is false, or not interrupted when they are true.

bitdancer commented 8 years ago

The first phase says "restarted when interrupted", the second phrase says "interrupted". So the difference is whether the system call is restarted or left in interrupted state (ie: the signal will propagate, which is confirmed by the second paragraph). I can't see a way to phrase it any more clearly, can you?

vstinner commented 8 years ago

For more information on how Python handles signals, you can also read the PEP-475 (which changed how Python 3.5 handles signals ;-))