version-info --include-history UnicodeDecodeError (518609)

Stephen J. Turnbull stephen at xemacs.org
Fri Apr 9 01:51:33 BST 2010


Robert Collins writes:

 > version info has a number of different formatters available; some may
 > make sense only as files, some could encode to the local encoding. I
 > don't think thats ideal; perhaps we could make the formatter 'know' that
 > it is writing to stdout and error unless stdout is a pipe (and thus
 > presumably being redirected). That seems fragile though.

Nope.  This is TOOWTDI.  Inside of Bazaar, everything should be
explicitly Unicode (if "text", ie, intended to be human-readable) or
str (if humans never read it without the intermediation of some
application).  Stuff in str format probably should be encapsulated in
some class, but that's beyond the scope of this post.  Unicode is
*the* encapsulation for text.  End of story.

This implies that text *must* be converted on exit from Bazaar.  All
exits must be watched, just as all entrances must be watched.  stdout
and stderr are nondeterministic, but the heuristic "convert to
top-level locale encoding if a TTY, else to UTF-8" should work well in
practice.  (Except maybe on Windows, where the widechar Unicode API
might be more appropriate for non-TTYs.)

 > I think you are right, that using a filename in the command avoid the
 > question about what to do here.

Do allow the '-' hack for stdout, then.



More information about the bazaar mailing list