allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#8152] encode filename as utf8 bytes so that any nested files/dirs with unicode get deleted properly
Date Fri, 14 Apr 2017 15:57:48 GMT
Repository: allura
Updated Branches:
  refs/heads/db/8152 [created] aa28de02e


[#8152] encode filename as utf8 bytes so that any nested files/dirs with unicode get deleted
properly


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/aa28de02
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/aa28de02
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/aa28de02

Branch: refs/heads/db/8152
Commit: aa28de02ea307f394ebd40304040144d30557d44
Parents: a2dfcb2
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Apr 14 11:57:18 2017 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Apr 14 11:57:18 2017 -0400

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/aa28de02/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 2a9c480..28545bb 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -708,7 +708,7 @@ class SVNImplementation(M.RepositoryImplementation):
                                 (archive_name, '.zip'))
         tmpfilename = os.path.join(self._repo.tarball_path, '%s%s' %
                                    (archive_name, '.tmp'))
-        rmtree(dest, ignore_errors=True)
+        rmtree(dest.encode('utf8'), ignore_errors=True)  # must encode into bytes or it'll
fail on non-ascii filenames
         path = os.path.join(self._url, path)
         try:
             # need to set system locale to handle all symbols in filename
@@ -722,7 +722,7 @@ class SVNImplementation(M.RepositoryImplementation):
             zipdir(dest, tmpfilename)
             os.rename(tmpfilename, filename)
         finally:
-            rmtree(dest, ignore_errors=True)
+            rmtree(dest.encode('utf8'), ignore_errors=True)
             if os.path.exists(tmpfilename):
                 os.remove(tmpfilename)
 


Mime
View raw message