Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
46129544
Kaydet (Commit)
46129544
authored
Nis 10, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21859: Corrected FileIO docstrings.
üst
1aa2c0f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
fileio.c
Modules/_io/fileio.c
+17
-14
No files found.
Modules/_io/fileio.c
Dosyayı görüntüle @
46129544
...
@@ -217,7 +217,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
...
@@ -217,7 +217,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
if
(
!
PyErr_Occurred
())
{
if
(
!
PyErr_Occurred
())
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
"
Negative file
descriptor"
);
"
negative file
descriptor"
);
return
-
1
;
return
-
1
;
}
}
PyErr_Clear
();
PyErr_Clear
();
...
@@ -949,7 +949,7 @@ fileio_isatty(fileio *self)
...
@@ -949,7 +949,7 @@ fileio_isatty(fileio *self)
PyDoc_STRVAR
(
fileio_doc
,
PyDoc_STRVAR
(
fileio_doc
,
"file(name: str[, mode: str]) -> file IO object
\n
"
"file(name: str[, mode: str]) -> file IO object
\n
"
"
\n
"
"
\n
"
"Open a file. The mode can be 'r'
, 'w' or 'a' for reading (default)
,
\n
"
"Open a file. The mode can be 'r'
(default), 'w' or 'a' for reading
,
\n
"
"writing or appending. The file will be created if it doesn't exist
\n
"
"writing or appending. The file will be created if it doesn't exist
\n
"
"when opened for writing or appending; it will be truncated when
\n
"
"when opened for writing or appending; it will be truncated when
\n
"
"opened for writing. Add a '+' to the mode to allow simultaneous
\n
"
"opened for writing. Add a '+' to the mode to allow simultaneous
\n
"
...
@@ -972,22 +972,22 @@ PyDoc_STRVAR(write_doc,
...
@@ -972,22 +972,22 @@ PyDoc_STRVAR(write_doc,
"write(b: bytes) -> int. Write bytes b to file, return number written.
\n
"
"write(b: bytes) -> int. Write bytes b to file, return number written.
\n
"
"
\n
"
"
\n
"
"Only makes one system call, so not all of the data may be written.
\n
"
"Only makes one system call, so not all of the data may be written.
\n
"
"The number of bytes actually written is returned."
);
"The number of bytes actually written is returned. In non-blocking mode,
\n
"
"returns None if the write would block."
);
PyDoc_STRVAR
(
fileno_doc
,
PyDoc_STRVAR
(
fileno_doc
,
"fileno() -> int.
\"
file descriptor
\"
.
\n
"
"fileno() -> int. Return the underlying file descriptor (an integer)."
);
"
\n
"
"This is needed for lower-level file interfaces, such the fcntl module."
);
PyDoc_STRVAR
(
seek_doc
,
PyDoc_STRVAR
(
seek_doc
,
"seek(offset: int[, whence: int]) -> int. Move to new file position
\n
"
"seek(offset: int[, whence: int]) -> int. Move to new file position
\n
"
"and return the file position.
\n
"
"and return the file position.
\n
"
"
\n
"
"
\n
"
"Argument offset is a byte count. Optional argument whence defaults to
\n
"
"Argument offset is a byte count. Optional argument whence defaults to
\n
"
"
0 (offset from start of file, offset should be >= 0); other values are 1
\n
"
"
SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
\n
"
"
(move relative to current position, positive or negative), and 2 (move
\n
"
"
are SEEK_CUR or 1 (move relative to current position, positive or negative),
\n
"
"
relative to end of file, usually negative, although many platforms allow
\n
"
"
and SEEK_END or 2 (move relative to end of file, usually negative, although
\n
"
"
seeking beyond the end of a file).
"
"
many platforms allow seeking beyond the end of a file).
\n
"
"
\n
"
"
\n
"
"Note that not all file objects are seekable."
);
"Note that not all file objects are seekable."
);
...
@@ -1001,7 +1001,10 @@ PyDoc_STRVAR(truncate_doc,
...
@@ -1001,7 +1001,10 @@ PyDoc_STRVAR(truncate_doc,
#endif
#endif
PyDoc_STRVAR
(
tell_doc
,
PyDoc_STRVAR
(
tell_doc
,
"tell() -> int. Current file position"
);
"tell() -> int. Current file position.
\n
"
"
\n
"
"Can raise OSError for non seekable files."
);
PyDoc_STRVAR
(
readinto_doc
,
PyDoc_STRVAR
(
readinto_doc
,
"readinto() -> Same as RawIOBase.readinto()."
);
"readinto() -> Same as RawIOBase.readinto()."
);
...
@@ -1010,10 +1013,10 @@ PyDoc_STRVAR(close_doc,
...
@@ -1010,10 +1013,10 @@ PyDoc_STRVAR(close_doc,
"close() -> None. Close the file.
\n
"
"close() -> None. Close the file.
\n
"
"
\n
"
"
\n
"
"A closed file cannot be used for further I/O operations. close() may be
\n
"
"A closed file cannot be used for further I/O operations. close() may be
\n
"
"called more than once without error.
Changes the fileno to -1.
"
);
"called more than once without error."
);
PyDoc_STRVAR
(
isatty_doc
,
PyDoc_STRVAR
(
isatty_doc
,
"isatty() -> bool. True if the file is connected to a
tty
device."
);
"isatty() -> bool. True if the file is connected to a
TTY
device."
);
PyDoc_STRVAR
(
seekable_doc
,
PyDoc_STRVAR
(
seekable_doc
,
"seekable() -> bool. True if file supports random-access."
);
"seekable() -> bool. True if file supports random-access."
);
...
@@ -1066,7 +1069,7 @@ get_mode(fileio *self, void *closure)
...
@@ -1066,7 +1069,7 @@ get_mode(fileio *self, void *closure)
static
PyGetSetDef
fileio_getsetlist
[]
=
{
static
PyGetSetDef
fileio_getsetlist
[]
=
{
{
"closed"
,
(
getter
)
get_closed
,
NULL
,
"True if the file is closed"
},
{
"closed"
,
(
getter
)
get_closed
,
NULL
,
"True if the file is closed"
},
{
"closefd"
,
(
getter
)
get_closefd
,
NULL
,
{
"closefd"
,
(
getter
)
get_closefd
,
NULL
,
"True if the file descriptor will be closed"
},
"True if the file descriptor will be closed
by close().
"
},
{
"mode"
,
(
getter
)
get_mode
,
NULL
,
"String giving the file mode"
},
{
"mode"
,
(
getter
)
get_mode
,
NULL
,
"String giving the file mode"
},
{
NULL
},
{
NULL
},
};
};
...
...
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