[GRASS-dev] GRASS 7.2RC2 problem
Vaclav Petras
wenzeslaus at gmail.com
Wed Dec 7 18:41:19 PST 2016
The issue is solved in Python 2.7.12 from 2016-06-25.
https://hg.python.org/cpython/raw-file/v2.7.12/Misc/NEWS
On Wed, Dec 7, 2016 at 6:59 PM, Michael Barton <Michael.Barton at asu.edu>
wrote:
> We need to do something other than update Python.
There is not that much which can be done on the GRASS site. According to
Python issue #26083, the root of the problem is in Mac OS read() which
causes pre-2.7.12 subprocess package to fail on anything longer than 512
bytes when piping is used (significant part of GRASS Python code in GUI,
lib and modules). We can workaround it (example below causing other things
to fail), included fixed subprocess code in GRASS or switch to
subprocess32. None of these is feasible for 7.2 and they are not even worth
it considering that the fixed Python was released.
Example workaround (not recommended):
Index: gui/wxpython/core/toolboxes.py
===================================================================
--- gui/wxpython/core/toolboxes.py (revision 70036)
+++ gui/wxpython/core/toolboxes.py (working copy)
@@ -670,8 +670,20 @@
try:
task = gtask.parse_interface(module)
except ScriptError as e:
+ # This tries to solve failed build or run of a module
sys.stderr.write("%s: %s\n" % (module, e))
return '', ''
+ except ValueError as e:
+ # This is testing for Python's #26083 on Mac OS.
+ # http://bugs.python.org/issue26083
+ # The whole except ValueError should be removed once it
+ # is fixed in Python (likely 2.7.12) or subprocess32 is used.
+ from sys import platform
+ if platform == "darwin":
+ sys.stderr.write("%s: %s\n" % (module, e))
+ return '', ''
+ # raise exception again on other platforms
+ raise
return task.get_description(full=True), \
task.get_keywords()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20161207/9c68a5fa/attachment.html>
More information about the grass-dev
mailing list