[zpkg] SVN: zpkgtools/trunk/zpkgtools/svnloader.py avoid having Subversion translate human-readable output when we actually

Fred L. Drake, Jr. fdrake at gmail.com
Fri Sep 16 10:40:38 EDT 2005


Log message for revision 38486:
  avoid having Subversion translate human-readable output when we actually
  want to test the output content within zpkg
  (problem reported by Roger Ineichen)
  

Changed:
  U   zpkgtools/trunk/zpkgtools/svnloader.py

-=-
Modified: zpkgtools/trunk/zpkgtools/svnloader.py
===================================================================
--- zpkgtools/trunk/zpkgtools/svnloader.py	2005-09-16 12:58:08 UTC (rev 38485)
+++ zpkgtools/trunk/zpkgtools/svnloader.py	2005-09-16 14:40:38 UTC (rev 38486)
@@ -314,10 +314,18 @@
 
         """
         # do an "svn cat" to get a file, or learn that this is a directory
+        lc_all = os.environ.get("LC_ALL")
         cmd = 'svn cat "%s"' % url
         runlog.report_command(cmd)
-        stdin, stdout, stderr = os.popen3(cmd)
-        data = stdout.read()
+        os.environ["LC_ALL"] = "C"
+        try:
+            stdin, stdout, stderr = os.popen3(cmd)
+            data = stdout.read()
+        finally:
+            if lc_all is None:
+                del os.environ["LC_ALL"]
+            else:
+                os.environ["LC_ALL"] = lc_all
         if not data:
             # maybe url referenced a directory
             err = stderr.readline()



More information about the zpkg mailing list