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

2012-08-03 Thread STINNER Victor
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,

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

2012-08-03 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15547 ___ ___

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

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: To check if os.truncate() supports file description, os.truncate in os.supports_fd checek can be used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15547

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

2012-08-03 Thread Larry Hastings
Larry Hastings added the comment: Because both functions were available in 3.2, and we can't remove old functions without a full deprecation cycle. -- resolution: - wont fix stage: - committed/rejected status: open - closed ___ Python tracker

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

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: Oh, I see: os.ftruncate() is present in Python 3.2; but os.truncate() was added to Python 3.3. Ok, it's an excellent reason to not remove os.ftruncate() ;-) -- ___ Python tracker rep...@bugs.python.org