[GRASS-SVN] r73322 - grass/trunk/scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 13 09:12:54 PDT 2018
Author: annakrat
Date: 2018-09-13 09:12:54 -0700 (Thu, 13 Sep 2018)
New Revision: 73322
Modified:
grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: fix for Python2/3
Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py 2018-09-12 13:02:20 UTC (rev 73321)
+++ grass/trunk/scripts/g.extension/g.extension.py 2018-09-13 16:12:54 UTC (rev 73322)
@@ -160,7 +160,6 @@
import grass.script as gscript
from grass.script.utils import try_rmdir
from grass.script import core as grass
-from grass.script.utils import decode
# i18N
import gettext
@@ -1041,12 +1040,11 @@
for name in files:
filename = os.path.join(root, name)
data = open(filename, 'rb').read()
- data = decode(data)
if '\0' in data:
continue # ignore binary files
# we don't expect there would be CRLF file by purpose
# if we want to allow CRLF files we would have to whitelite .py etc
- newdata = data.replace('\r\n', '\n')
+ newdata = data.replace(b'\r\n', b'\n')
if newdata != data:
newfile = open(filename, 'wb')
newfile.write(newdata)
More information about the grass-commit
mailing list