Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
d85e3d0c
Commit
d85e3d0c
authored
Nov 09, 2020
by
scoder
Committed by
GitHub
Nov 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comment from CPython docs that these functions are considered legacy.
parent
a23f5cf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
Cython/Includes/cpython/fileobject.pxd
Cython/Includes/cpython/fileobject.pxd
+15
-1
No files found.
Cython/Includes/cpython/fileobject.pxd
View file @
d85e3d0c
"""
From https://docs.python.org/3.9/c-api/file.html
These APIs are a minimal emulation of the Python 2 C API for built-in file objects,
which used to rely on the buffered I/O (FILE*) support from the C standard library.
In Python 3, files and streams use the new io module, which defines several layers
over the low-level unbuffered I/O of the operating system. The functions described
below are convenience C wrappers over these new APIs, and meant mostly for internal
error reporting in the interpreter;
third-party code is advised to access the io APIs instead.
"""
cdef
extern
from
"Python.h"
:
###########################################################################
# File Objects
###########################################################################
object
PyFile_FromFd
(
int
fd
,
const
char
*
name
,
const
char
*
mode
,
int
buffering
,
const
char
*
encoding
,
const
char
*
errors
,
const
char
*
newline
,
int
closefd
)
object
PyFile_FromFd
(
int
fd
,
const
char
*
name
,
const
char
*
mode
,
int
buffering
,
const
char
*
encoding
,
const
char
*
errors
,
const
char
*
newline
,
int
closefd
)
# Return value: New reference.
# Create a Python file object from the file descriptor of an already
# opened file fd. The arguments name, encoding, errors and newline can be
...
...
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