[GRASS-SVN] r68357 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 2 09:08:06 PDT 2016


Author: zarch
Date: 2016-05-02 09:08:06 -0700 (Mon, 02 May 2016)
New Revision: 68357

Modified:
   grass/trunk/lib/python/script/core.py
Log:
script: fix in python3 sys.stdout.write accept only strings not bytes

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2016-05-02 16:08:00 UTC (rev 68356)
+++ grass/trunk/lib/python/script/core.py	2016-05-02 16:08:06 UTC (rev 68357)
@@ -733,7 +733,8 @@
     lines = s.split(b'\0')
 
     if not lines or lines[0] != b"@ARGS_PARSED@":
-        sys.stdout.write(s)
+        stdout = os.fdopen(sys.stdout.fileno(), 'wb')
+        stdout.write(s)
         sys.exit(p.returncode)
     return _parse_opts(lines[1:])
 



More information about the grass-commit mailing list