~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Martin Packman
  • Date: 2012-04-30 10:44:04 UTC
  • mto: (6437.54.4 2.5)
  • mto: This revision was merged to the branch mainline in revision 6525.
  • Revision ID: martin.packman@canonical.com-20120430104404-0tqn17kcmiv793fh
Correct and test fallback to ascii logic when a stream has no encoding

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
    def __init__(self, term_file, encoding=None, errors="replace"):
408
408
        self._term_file = term_file
409
409
        if encoding is None:
410
 
            self._encoding = getattr(term_file, "encoding", "ascii")
 
410
            self._encoding = getattr(term_file, "encoding", None) or "ascii"
411
411
        else:
412
412
            self._encoding = encoding
413
413
        self._encoding_errors = errors