~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin
  • Date: 2010-08-05 23:49:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5373.
  • Revision ID: gzlist@googlemail.com-20100805234924-hftl1rfcubsiju8u
Rather than using codecs.open with potentially invalid flags when getting a commit message, just decode the bytes after reading

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib.lazy_import import lazy_import
22
22
lazy_import(globals(), """
23
 
import codecs
24
23
import cStringIO
25
24
import sys
26
25
import time
3150
3149
        def get_message(commit_obj):
3151
3150
            """Callback to get commit message"""
3152
3151
            if file:
3153
 
                f = codecs.open(file, 'rt', osutils.get_user_encoding())
 
3152
                f = open(file)
3154
3153
                try:
3155
 
                    my_message = f.read()
 
3154
                    my_message = f.read().decode(osutils.get_user_encoding())
3156
3155
                finally:
3157
3156
                    f.close()
3158
3157
            elif message is not None: