Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(196286)

Unified Diff: Doc/library/fcntl.rst

Issue 23001: Accept mutable bytes-like objects
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Doc/library/mmap.rst » ('j') | Doc/library/socket.rst » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/fcntl.rst Wed Mar 18 21:36:23 2015 -0500
+++ b/Doc/library/fcntl.rst Thu Mar 19 13:16:44 2015 +0200
@@ -35,13 +35,14 @@ The module defines the following functio
for *op* are operating system dependent, and are available as constants
in the :mod:`fcntl` module, using the same names as used in the relevant C
header files. The argument *arg* is optional, and defaults to the integer
- value ``0``. When present, it can either be an integer value, or a string.
- With the argument missing or an integer value, the return value of this function
- is the integer return value of the C :c:func:`fcntl` call. When the argument is
- a string it represents a binary structure, e.g. created by :func:`struct.pack`.
+ value ``0``. When present, it can either be an integer value, or a
+ :term:`bytes-like object`. With the argument missing or an integer value,
+ the return value of this function is the integer return value of the C
+ :c:func:`fcntl` call. When the argument is a bytes-like object it
+ represents a binary structure, e.g. created by :func:`struct.pack`.
The binary data is copied to a buffer whose address is passed to the C
:c:func:`fcntl` call. The return value after a successful call is the contents
- of the buffer, converted to a string object. The length of the returned string
+ of the buffer, converted to a bytes object. The length of the returned bytes
will be the same as the length of the *arg* argument. This is limited to 1024
bytes. If the information returned in the buffer by the operating system is
larger than 1024 bytes, this is most likely to result in a segmentation
@@ -49,6 +50,9 @@ The module defines the following functio
If the :c:func:`fcntl` fails, an :exc:`OSError` is raised.
+ .. versionchanged: 3.5
+ Writable :term:`bytes-like object` is now accepted as the *arg* argument.
+
.. function:: ioctl(fd, op[, arg[, mutate_flag]])
« no previous file with comments | « no previous file | Doc/library/mmap.rst » ('j') | Doc/library/socket.rst » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+