every command twice encode sys.stdout?

Bug #199442 reported by Alexander Belchenko
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

Looking at .bzr.log I noticed that message about encoding stdout to some encoding appears twice. Here is quintessence for `bzr --no-plugins version`:

0.971 encoding stdout as sys.stdout encoding 'cp866'
0.992 bzr arguments: [u'--no-plugins', u'version']
1.282 encoding stdout as sys.stdout encoding 'cp866'
1.422 return code 0

Revision history for this message
Vincent Ladeuil (vila) wrote :

Hi Alexander !

You're right, the first one is due to trace.enable_default_logging() and the second one to commands._setup_outf().

The most disturbing thing IMHO is that get_terminal_encoding() has a side-effect which actually modifies the terminal encoding even if the function is prefixed with 'get_'.

Changed in bzr:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 199442] Re: every command twice encode sys.stdout?

vila пишет:
> You're right, the first one is due to trace.enable_default_logging() and
> the second one to commands._setup_outf().
>
> The most disturbing thing IMHO is that get_terminal_encoding() has a
> side-effect which actually modifies the terminal encoding even if the
> function is prefixed with 'get_'.

No, I disagree, there is no side-effects. Only mutter twice mutters.
And waste of time, because every time encoding is checked for validity.

I guess caching will help, and I have branch with such change. But global
caching is sucks for tests.

Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.