[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-04-02 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I applied the first part of the patch in r79580. I don't see that the second part is necessary, the other functions don't have such a note. -- resolution: - fixed status: open - closed ___ Python

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Neil Muller
Neil Muller drnlmuller+b...@gmail.com added the comment: Poking this issue with updated patches. Patch against py3k. -- Added file: http://bugs.python.org/file16650/posixmodule_comb_py3k.patch ___ Python tracker rep...@bugs.python.org

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Neil Muller
Changes by Neil Muller drnlmuller+b...@gmail.com: Added file: http://bugs.python.org/file16651/posixmodule_comb.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768 ___

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Actually, I'm not sure it's a good idea. For example, calling os.ftruncate(fobj) on a py3k file object will bypass the object's internal buffering, ignoring any pending buffered data; the right thing to do is to call fobj.truncate() instead.

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Neil Muller
Neil Muller drnlmuller+b...@gmail.com added the comment: Fair enough. Possible doc patch attached. -- Added file: http://bugs.python.org/file16654/fileno_doc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - georg.brandl components: +Documentation -Extension Modules nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2010-03-25 Thread Neil Muller
Neil Muller drnlmuller+b...@gmail.com added the comment: More fleshed out doc patch. Mention caveats about using file descriptors directly, add note to ftruncate similar to that for other dangerous methods. -- Added file: http://bugs.python.org/file16655/fileno_doc.diff

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2009-06-05 Thread Neil Muller
Neil Muller drnlmuller+b...@gmail.com added the comment: Updated combined patch for python trunk added (indentation issues hopefully also fixed). -- Added file: http://bugs.python.org/file14199/posixmodule_comb.patch ___ Python tracker

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2009-06-05 Thread Neil Muller
Neil Muller drnlmuller+b...@gmail.com added the comment: Similar patch for the python 3 branch. -- Added file: http://bugs.python.org/file14200/posixmodule_comb_py3k.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2009-05-12 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- nosy: +benjamin.peterson, pitrou stage: - patch review versions: +Python 2.7, Python 3.2 -Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2009-05-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Please produce a single patch comprising all changes. Also, there seem to be some misindentations in the modified C code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2008-05-11 Thread Neil Muller
Neil Muller [EMAIL PROTECTED] added the comment: This patch combines the two earlier patches, and also updates the docstrings and os.rst to reflect the changed behaviour. Added file: http://bugs.python.org/file10281/posixmodule_2.patch __ Tracker [EMAIL

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2008-05-10 Thread Neil Muller
Neil Muller [EMAIL PROTECTED] added the comment: The attached patch changes most functions in posixmodule which require a filedescriptor to use PyObjectAsDescriptor There are a few cases, where I'm not certain of the usefulness of changing the functions to support objects with fileno that I've

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2008-05-10 Thread Neil Muller
Neil Muller [EMAIL PROTECTED] added the comment: Patches to test_posix.py to also test using file objects in os.fstat and such. Added file: http://bugs.python.org/file10243/test_posix.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2768

[issue2768] os.fstat and other os.f* methods should use PyObject_AsFileDescriptor

2008-05-05 Thread Christian Heimes
New submission from Christian Heimes [EMAIL PROTECTED]: os.fstat doesn't accept a file object with a fileno() method. This can easily be fixed by using PyObject_AsFileDescriptor(). Other os.f* methods may suffer from the same issue. -- components: Extension Modules keywords: easy