[GRASS-SVN] r70025 - grass-addons/grass7/raster/r.catchment

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 6 15:23:44 PST 2016


Author: isaacullah
Date: 2016-12-06 15:23:44 -0800 (Tue, 06 Dec 2016)
New Revision: 70025

Modified:
   grass-addons/grass7/raster/r.catchment/r.catchment.py
Log:
Minor edit to resolve issue with temporary files on Windows OS. Replaced old use of tempfile.NamedTemporaryFile with standard GRASS python interface to g.tempfile (grass.tempfile). This should mitigate issues on Windows.

Modified: grass-addons/grass7/raster/r.catchment/r.catchment.py
===================================================================
--- grass-addons/grass7/raster/r.catchment/r.catchment.py	2016-12-06 23:22:54 UTC (rev 70024)
+++ grass-addons/grass7/raster/r.catchment/r.catchment.py	2016-12-06 23:23:44 UTC (rev 70025)
@@ -321,7 +321,7 @@
         "units." % (int(cutoff), displayarea)))
     ####################################################
         grass.verbose(_('Creating output map'))
-        temp = open(grass.tempfile(), w+)
+        temp = open(grass.tempfile(), 'w+')
         temp.write('0 thru %s = %s\n' % (int(cutoff),  mapval))
         temp.flush()
         grass.run_command('r.reclass', overwrite=grass.overwrite(), input=cost,



More information about the grass-commit mailing list