Re: [PATCH] Run programs with LC_ALL=C in case we're parsing output (#492549).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good,

Regards,

Hans

On 04/13/2009 07:41 PM, Chris Lumens wrote:
---
  iutil.py |   12 ++++++++++--
  1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/iutil.py b/iutil.py
index 221504f..7d90c9f 100644
--- a/iutil.py
+++ b/iutil.py
@@ -81,11 +81,15 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
      runningLog = open("/tmp/program.log", "a")
      runningLog.write("Running... %s\n" % ([command] + argv,))

+    env = os.environ.copy()
+    env.update({"LC_ALL": "C"})
+
      try:
          proc = subprocess.Popen([command] + argv, stdin=stdin,
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE,
-                                preexec_fn=chroot, cwd=root)
+                                preexec_fn=chroot, cwd=root
+                                env=env)

          while True:
              (outStr, errStr) = proc.communicate()
@@ -143,11 +147,15 @@ def execWithCapture(command, argv, stdin = None, stderr = None, root='/'):
      runningLog = open("/tmp/program.log", "a")
      runningLog.write("Running... %s\n" % ([command] + argv,))

+    env = os.environ.copy()
+    env.update({"LC_ALL": "C"})
+
      try:
          proc = subprocess.Popen([command] + argv, stdin=stdin,
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE,
-                                preexec_fn=chroot, cwd=root)
+                                preexec_fn=chroot, cwd=root,
+                                env=env)

          while True:
              (outStr, errStr) = proc.communicate()

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux