This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: fcntl doc: document exceptions raised on error for ioctl() and flock()
Type: Stage:
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, martin.panter, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2015-11-12 09:29 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fcntl_doc.patch vstinner, 2015-11-12 09:29 review
Messages (4)
msg254524 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-12 09:29
Attached patch documents the exception raised when ioctl() or flock() functions fail.

Note: flock() can also raises a ValueError if the second parameter (op) is unknown.

If the patch is approved, I will write a similar patch for Python 3 (just replace IOError with OSError in Python 3 doc).

Python 2 online doc:
https://docs.python.org/2/library/fcntl.html

Python 3 online doc:
https://docs.python.org/dev/library/fcntl.html
msg254572 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-11-12 23:19
This looks good for Python 2 and the equivalent for Python 3.

FWIW the ValueError case is platform-dependent. On Linux, I see EINVAL (the IOError version of ValueError):

>>> flock(0, LOCK_UN)
>>> flock(0, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 22] Invalid argument
msg254590 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-13 08:14
New changeset d3d974e92e6f by Victor Stinner in branch '2.7':
Issue #25605: Document exceptions raised by fcntl.ioctl() and fcntl.flock()
https://hg.python.org/cpython/rev/d3d974e92e6f

New changeset f82cd1ed659e by Victor Stinner in branch '3.4':
Issue #25605: Document exceptions raised by fcntl.ioctl() and fcntl.flock()
https://hg.python.org/cpython/rev/f82cd1ed659e

New changeset cf69fe41f873 by Victor Stinner in branch '3.5':
Merge 3.4 (issue #25605)
https://hg.python.org/cpython/rev/cf69fe41f873

New changeset 0eddeb57c3d6 by Victor Stinner in branch 'default':
Merge 3.5 (issue #25605)
https://hg.python.org/cpython/rev/0eddeb57c3d6
msg254591 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-13 08:14
Thanks for the review.
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69791
2015-11-13 08:14:53vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg254591
2015-11-13 08:14:46python-devsetnosy: + python-dev
messages: + msg254590
2015-11-12 23:19:17martin.pantersetnosy: + martin.panter
messages: + msg254572
2015-11-12 09:29:02vstinnercreate