changeset 122:04c92c2c4501

SubversionRepo: work around ra.get_files() not releasing input buffer
author Patrick Mezard <pmezard@gmail.com>
date Tue, 02 Dec 2008 20:13:13 -0600
parents 5438cc2d7ed7
children 58de7aea8a77
files svnwrap/svn_swig_wrapper.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/svnwrap/svn_swig_wrapper.py
+++ b/svnwrap/svn_swig_wrapper.py
@@ -437,9 +437,11 @@ class SubversionRepo(object):
         IOError.
         """
         mode = ''
-        out = cStringIO.StringIO()
         try:
+            out = cStringIO.StringIO()
             info = ra.get_file(self.ra, path, revision, out)
+            data = out.getvalue()
+            out.close()
             if isinstance(info, list):
                 info = info[-1]
             mode = ("svn:executable" in info) and 'x' or ''
@@ -450,7 +452,6 @@ class SubversionRepo(object):
             if e.apr_err in notfound: # File not found
                 raise IOError()
             raise
-        data = out.getvalue()
         if mode  == 'l':
             linkprefix = "link "
             if data.startswith(linkprefix):