[Python-bugs-list] [ python-Feature Requests-764188 ] setvbuf for File object
SourceForge.net
noreply@sourceforge.net
Tue, 29 Jul 2003 10:04:13 -0700
Feature Requests item #764188, was opened at 2003-07-01 20:21
Message generated for change (Comment added) made by yueluo
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=764188&group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Yue Luo (yueluo)
Assigned to: Nobody/Anonymous (nobody)
Summary: setvbuf for File object
Initial Comment:
I wonder if it is possible to add a new method setvbuf to
File object. The method does the same as the setvbuf()
in stdio.h.
----------------------------------------------------------------------
>Comment By: Yue Luo (yueluo)
Date: 2003-07-29 17:04
Message:
Logged In: YES
user_id=806666
The -u command line option is not what I had in mind, but it
will achieve exactly what I wanted. I just did not know
that it exists. Maybe this request can be closed.
Can I use the optional bufsize to file(), open(), to change
the buffer mode of the standard output? The stdout and
stderr are already opened.
----------------------------------------------------------------------
Comment By: Jean M. Brouwers (jbrouwers)
Date: 2003-07-29 00:27
Message:
Logged In: YES
user_id=832557
There is already an optional bufsize argument to file(),
open() and fdopen(). It allows you to specify unbuffered
(0), line buffered (1), system default (-1) or buffered
usage with a specific buffer size (>1). Are you requesting
something different?
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-07-08 06:57
Message:
Logged In: YES
user_id=21627
I see. Can you explain why invoking "python -u" is insufficient?
----------------------------------------------------------------------
Comment By: Yue Luo (yueluo)
Date: 2003-07-07 23:14
Message:
Logged In: YES
user_id=806666
Sorry, I did not make myself clear. I just want to be able to
change the buffer size or the buffer mode of a file object.
Especially, I often want to change the standard output buffer
mode to line buffer so that I can see the result immediately
even when the output has been redirected.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-07-07 22:08
Message:
Logged In: YES
user_id=21627
What buf argument would you like to pass?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=764188&group_id=5470