~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-18 02:46:15 UTC
  • mfrom: (5236.1.1 working-tree-get-file-text)
  • Revision ID: pqm@pqm.ubuntu.com-20100518024615-dmqzcnicw5p48k53
(lifeless) Explicitly close the file handle in WT.get_file_text. (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
        return (file_obj, stat_value)
464
464
 
465
465
    def get_file_text(self, file_id, path=None, filtered=True):
466
 
        return self.get_file(file_id, path=path, filtered=filtered).read()
 
466
        my_file = self.get_file(file_id, path=path, filtered=filtered)
 
467
        try:
 
468
            return my_file.read()
 
469
        finally:
 
470
            my_file.close()
467
471
 
468
472
    def get_file_byname(self, filename, filtered=True):
469
473
        path = self.abspath(filename)