~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/textfile.py

  • Committer: Aaron Bentley
  • Date: 2006-04-16 16:20:46 UTC
  • mto: This revision was merged to the branch mainline in revision 1673.
  • Revision ID: aaron.bentley@utoronto.ca-20060416162046-a50698189b032755
Handle binary files for diff3 merges

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    f = IterableFile(lines)
21
21
    if '\x00' in f.read(1024):
22
22
        raise BinaryFile()
 
23
 
 
24
def check_text_path(path):
 
25
    """Check whether the supplied path is a text, not binary file.
 
26
    Raise BinaryFile if a NUL occurs in the first 1024 bytes.
 
27
    """
 
28
    text_file(open(path, 'rb'))