[New-bugs-announce] [issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

STINNER Victor report at bugs.python.org
Fri Aug 3 14:13:04 CEST 2012


New submission from STINNER Victor:

posix_truncate() accepts a file descriptor, so os.ftruncate() can be removed from Python 3.3.

    memset(&path, 0, sizeof(path));
    path.function_name = "truncate";
#ifdef HAVE_FTRUNCATE
    path.allow_fd = 1;
#endif
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&:truncate", keywords,
                                     path_converter, &path,
                                     _parse_off_t, &length))
        return NULL;

----------
messages: 167311
nosy: haypo, larry
priority: deferred blocker
severity: normal
status: open
title: Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15547>
_______________________________________


More information about the New-bugs-announce mailing list