[rfc] Help needed: encodings problems again
Robert Collins
robertc at robertcollins.net
Tue Jun 13 08:44:06 BST 2006
On Tue, 2006-06-13 at 09:02 +0200, Anthon van der Neut wrote:
> I have not read through all of the 12000 messages in this mailing list
> (yet) so excuses if this has come up before.
>
> Is there any reason not to redirect sys.stdout to some other object that
> does the `right' thing depending on whether the output is going to file
> or not. That way print can be used without any changes
We have 3 key layers in bzr:
- The console UI
- UI convenience functions
- The bzr library.
Functions in library cannot assume that they are being used in a single
thread, or from a console program : they need to behave like well
behaved python library routines, giving input and output in [hopefully]
appropriate ways to their callers.
Functions in the convenience function layer also cannot assume they are
being used from a single threaded program, or make other global state
assumptions.
The console UI layer can assume its being used as part of 'bzr FOO', and
thus can do whatever it likes to any global state, such as resetting the
ui factory, use print, redirect stdout etc.
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060613/fe66375e/attachment.pgp
More information about the bazaar
mailing list