~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/textfile.py

  • Committer: Wouter van Heyst
  • Date: 2006-07-13 18:18:00 UTC
  • mfrom: (1863 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1867.
  • Revision ID: larstiq@larstiq.dyndns.org-20060713181800-4e8c4f9326597d7f
[merge] bzr.dev 1863

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    """Check whether the supplied path is a text, not binary file.
47
47
    Raise BinaryFile if a NUL occurs in the first 1024 bytes.
48
48
    """
49
 
    text_file(open(path, 'rb'))
 
49
    f = open(path, 'rb')
 
50
    try:
 
51
        text_file(f)
 
52
    finally:
 
53
        f.close()