Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
858fa689
Commit
858fa689
authored
Sep 09, 2015
by
Martin Panter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os.sendfile(headers=None, trailers=None) arguments are not actually accepted
Needs to be tested on a BSD.
parent
34c08fad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Doc/library/os.rst
Doc/library/os.rst
+1
-1
Lib/test/test_os.py
Lib/test/test_os.py
+1
-1
Modules/posixmodule.c
Modules/posixmodule.c
+3
-3
No files found.
Doc/library/os.rst
View file @
858fa689
...
...
@@ -1072,7 +1072,7 @@ or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Window
.. function:: sendfile(out, in, offset, count)
sendfile(out, in, offset, count,
headers=None, trailers=None
, flags=0)
sendfile(out, in, offset, count,
[headers], [trailers]
, flags=0)
Copy *count* bytes from file descriptor *in* to file descriptor *out*
starting at *offset*.
...
...
Lib/test/test_os.py
View file @
858fa689
...
...
@@ -2170,7 +2170,7 @@ class TestSendfile(unittest.TestCase):
**
{
'in'
:
self
.
fileno
})
if
self
.
SUPPORT_HEADERS_TRAILERS
:
os
.
sendfile
(
self
.
sockno
,
self
.
fileno
,
offset
=
0
,
count
=
4096
,
headers
=
None
,
trailers
=
None
,
flags
=
0
)
headers
=
(),
trailers
=
()
,
flags
=
0
)
# --- headers / trailers tests
...
...
Modules/posixmodule.c
View file @
858fa689
...
...
@@ -8246,7 +8246,7 @@ posix_write(PyObject *self, PyObject *args)
#ifdef HAVE_SENDFILE
PyDoc_STRVAR
(
posix_sendfile__doc__
,
"sendfile(out, in, offset, count) -> byteswritten
\n
\
sendfile(out, in, offset, count
, headers=None, trailers=None
, flags=0)
\n
\
sendfile(out, in, offset, count
[, headers][, trailers]
, flags=0)
\n
\
-> byteswritten
\n
\
Copy count bytes from file descriptor in to file descriptor out."
);
...
...
@@ -8286,7 +8286,7 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict)
if
(
headers
!=
NULL
)
{
if
(
!
PySequence_Check
(
headers
))
{
PyErr_SetString
(
PyExc_TypeError
,
"sendfile() headers must be a sequence
or None
"
);
"sendfile() headers must be a sequence"
);
return
NULL
;
}
else
{
Py_ssize_t
i
=
0
;
/* Avoid uninitialized warning */
...
...
@@ -8303,7 +8303,7 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict)
if
(
trailers
!=
NULL
)
{
if
(
!
PySequence_Check
(
trailers
))
{
PyErr_SetString
(
PyExc_TypeError
,
"sendfile() trailers must be a sequence
or None
"
);
"sendfile() trailers must be a sequence"
);
return
NULL
;
}
else
{
Py_ssize_t
i
=
0
;
/* Avoid uninitialized warning */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment