Danek Duvall wrote:
> On Thu, Dec 18, 2008 at 11:55:58AM -0600, Shawn Walker wrote:
> 
>> swal...@zorander:~/devel/pkg-1931/src$ ./client.py verify SUNWsolnm
>>
>>
>> swal...@zorander:~/devel/pkg-1931/src$
> 
> That's the current output you're seeing?  Two newlines?  I'm only seeing
> one, running either /bin/sh or zsh:

Sorry, that was my mail client (?) I guess, since I definitely one see 
one line of output as well.

>> So, as you can see, the very last line of output from the program is the 
>> progress tracker (normally) when running verify.  By printing the cr, I am 
>> effectively telling python that there's nothing to terminate, so it doesn't 
>> add the newline.
> 
> Okay.  I didn't see anything at the URL you sent saying that if a CR was
> the last thing printed on a line, the softspace handling would be
> overridden and no newline printed.

You are right, their explanation doesn't document that, it was observed 
behaviour I discovered on my own, but it seemed logical to me in the 
context of their explanation.  Reading through the python source code 
itself, it also seems to make sense if you look at the main interpreter 
loop from lines 1530-1560 in the python 2.4.5 source drop; though at 
this point, I'm far-off into undocumented territory (not that python 
documents the at exit softspace behaviour either that I can find).

Hence why I'm still offering to attempt to use sys.stdout.write() 
instead.  To be clear, I didn't consider setting sys.stdout.softspace a 
viable aternative since I didn't want to assume that the last output 
from the program would be from the progress tracker.

Cheers,
-- 
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to