Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

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

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 3, 2012, 5:13 AM

Post #1 of 5 (111 views)
Permalink
[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

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>
<http://bugs.python.org/issue15547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 3, 2012, 5:26 AM

Post #2 of 5 (107 views)
Permalink
[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor? [In reply to]

Changes by STINNER Victor <victor.stinner [at] gmail>:


----------
nosy: +georg.brandl

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 3, 2012, 5:27 AM

Post #3 of 5 (107 views)
Permalink
[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor? [In reply to]

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 <report [at] bugs>
<http://bugs.python.org/issue15547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 3, 2012, 11:57 AM

Post #4 of 5 (101 views)
Permalink
[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor? [In reply to]

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 <report [at] bugs>
<http://bugs.python.org/issue15547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 3, 2012, 2:39 PM

Post #5 of 5 (101 views)
Permalink
[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor? [In reply to]

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 <report [at] bugs>
<http://bugs.python.org/issue15547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.