~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-09-05 08:48:24 UTC
  • mfrom: (2785.1.7 show-version)
  • Revision ID: pqm@pqm.ubuntu.com-20070905084824-xdwd8f4fioovdi9v
bugfix #131100: bzr --version should care about encoding of stdout
 (bialix,r=ianc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
449
449
 
450
450
        output_encoding = osutils.get_terminal_encoding()
451
451
 
452
 
        # use 'replace' so that we don't abort if trying to write out
453
 
        # in e.g. the default C locale.
454
 
        self.outf = codecs.getwriter(output_encoding)(sys.stdout, errors=self.encoding_type)
 
452
        self.outf = codecs.getwriter(output_encoding)(sys.stdout,
 
453
                        errors=self.encoding_type)
455
454
        # For whatever reason codecs.getwriter() does not advertise its encoding
456
455
        # it just returns the encoding of the wrapped file, which is completely
457
456
        # bogus. So set the attribute, so we can find the correct encoding later.
722
721
        return 0
723
722
 
724
723
    if argv[0] == '--version':
725
 
        from bzrlib.version import show_version
726
 
        show_version()
 
724
        from bzrlib.builtins import cmd_version
 
725
        cmd_version().run_argv_aliases([])
727
726
        return 0
728
727
        
729
728
    if not opt_no_plugins: