~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ignores.py

  • Committer: Vincent Ladeuil
  • Date: 2016-01-21 17:48:07 UTC
  • mto: This revision was merged to the branch mainline in revision 6613.
  • Revision ID: v.ladeuil+lp@free.fr-20160121174807-g4ybpaij9ln5wj6a
Make all transport put_bytes() raises TypeError when given unicode strings rather than bytes.

There was a mix of AssertionError or UnicodeEncodeError.

Also deleted test_put_file_unicode() which was bogus, files contain bytes not unicode strings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Lists of ignore files, etc."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import errno
20
22
import os
21
23
from cStringIO import StringIO
27
29
    atomicfile,
28
30
    config,
29
31
    globbing,
 
32
    trace,
30
33
    )
31
 
 
32
 
from trace import warning
33
34
""")
34
35
 
35
36
# ~/.bazaar/ignore will be filled out using
72
73
                unicode_lines.append(line.decode('utf-8'))
73
74
            except UnicodeDecodeError:
74
75
                # report error about line (idx+1)
75
 
                warning('.bzrignore: On Line #%d, malformed utf8 character. '
 
76
                trace.warning(
 
77
                        '.bzrignore: On Line #%d, malformed utf8 character. '
76
78
                        'Ignoring line.' % (line_number+1))
77
79
 
78
80
    # Append each line to ignore list if it's not a comment line