diff options
author | Robert Collins <rbtcollins@hp.com> | 2014-10-18 13:32:43 +1300 |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2014-10-18 13:32:43 +1300 |
commit | 933430ab69b051aa35130a3cf779528faca9b6f2 (patch) | |
tree | df0df6807ba2f82cc56d034c54226a5f2628abc9 /Modules/_io/fileio.c | |
parent | d20ec1b92196a01acf9bfb990329d06b4dee5c78 (diff) | |
download | cpython-git-933430ab69b051aa35130a3cf779528faca9b6f2.tar.gz |
Issue #17401: document closefd in io.FileIO docs and add to repr
closefd was documented in the open docs but not the matching FileIO
class documented. Further, closefd, part of the core state for the
object was not shown.
In review it was noted that the open docs are a little confusing about
the interaction between closefd and paths, so tweaked them at the same
time.
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r-- | Modules/_io/fileio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 2e0fbf9535..5c1316e9f4 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -1054,12 +1054,14 @@ fileio_repr(fileio *self) PyErr_Clear(); else return NULL; - res = PyUnicode_FromFormat("<_io.FileIO fd=%d mode='%s'>", - self->fd, mode_string(self)); + res = PyUnicode_FromFormat( + "<_io.FileIO fd=%d mode='%s' closefd='%d'>", + self->fd, mode_string(self), self->closefd); } else { - res = PyUnicode_FromFormat("<_io.FileIO name=%R mode='%s'>", - nameobj, mode_string(self)); + res = PyUnicode_FromFormat( + "<_io.FileIO name=%R mode='%s' closefd='%d'>", + nameobj, mode_string(self), self->closefd); Py_DECREF(nameobj); } return res; |