[BUNDLE] Make additional chance to obtain right encoding of console when output piped

Wouter van Heyst larstiq at larstiq.dyndns.org
Sat Jun 10 14:22:30 BST 2006


On Sat, Jun 10, 2006 at 11:19:38AM +0300, Alexander Belchenko wrote:
<snip>
> >This doesn't seem enough for 'bzr pull | less' though.
> >
> >bzr: ERROR: exceptions.TypeError: encode() argument 1 must be string, not 
> >None
> > at /home/larstiq/src/bzr/bzr.dev/bzrlib/urlutils.py line 468
> > in unescape_for_display
> 
> This error raised with or without my patch? Because in patch checked 
> encoding with conditional expression:

Patch is applied.

> if not encoding:
>     using default
> 
> So, if sys.stdin.encoding is None it was boolean False and in this case 
> bzr should use bzrlib.user_encoding value. I'm think that problem in 
> your bzrlib.user_encoding value. Can you show what encoding chosen by 
> looking at .bzr.log. In .bzr.log you can see line something like:

output_encoding does get set to UTF-8, but after 
    self.outf = codecs.getwriter(output_encoding)(sys.stdout, errors=self.encoding_type)
self.outf.encoding is None. sys.stdout.encoding at that point was None
also.

Wouter van Heyst




More information about the bazaar mailing list