[issue1241] subprocess.py stdout of childprocess always buffered.

2007-10-06 Thread Peter Ã…strand

Peter Ã…strand added the comment:

Most probably, this is not a problem with the Python side or the pipes,
but the libc streams in the application. stderr is normally unbuffered,
while stdout is buffered. You can see this by running the app with grep:

$ ./a.out | grep STDOUT
STDERR sleeping 0
STDERR sleeping 1
STDERR sleeping 2
STDERR sleeping 3

If you throw in a:

setvbuf(stdout, NULL, _IONBF, 0);

things will work the way you expect:

$ ./a.out | grep STDOUT
STDERR sleeping 0
STDOUT boo 0
STDOUT sleeping 0
STDERR sleeping 1
STDOUT boo 1

--
nosy: +astrand

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1243] option.dest not set when callback called with optparse

2007-10-06 Thread Chris Withers

New submission from Chris Withers:

The attached script demonstrates the bug.

option.dest should be set, even if not explicitly supplied in the call
to parser.add_option, by the time the callback is called.

Unless dest='something' is specified in the call to add_option, you will
get the following error when running "python test.py --myopt":

  File "test.py", line 4, in mycallback
setattr(parser.values,option.dest,value)
TypeError: attribute name must be string

...as options.dest is still None.

I would expect options.dest to be computed as per the algorithm in
optparse.Option._check_dest.

--
components: Library (Lib)
files: test.py
messages: 56252
nosy: cjw296
severity: normal
status: open
title: option.dest not set when callback called with optparse
versions: Python 2.3, Python 2.4, Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__from optparse import OptionParser

def mycallback(option,opt_str,value,parser):
setattr(parser.values,option.dest,value)

parser = OptionParser('bug demo')
parser.add_option('--myopt',action='callback',callback=mycallback)

options,args = parser.parse_args()
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1242] test

2007-10-06 Thread Georg Brandl

Georg Brandl added the comment:

This is a bug tracker, not a discussion forum. Please go to the
comp.lang.python newsgroup.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1240] str.split bug when using sep = None and maxsplit

2007-10-06 Thread Guido van Rossum

Guido van Rossum added the comment:

It was deemed a documentation bug.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1241] subprocess.py stdout of childprocess always buffered.

2007-10-06 Thread Guido van Rossum

Guido van Rossum added the comment:

This is how C stdio works in the subprocess.  Python's subprocess.py has
nothing to do with it and can't do anything about it.

--
nosy: +gvanrossum
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com