3

I am trying to reclassify a raster on QGIS 3.4 and I keep getting this error: File "/Applications/QGIS3.app/Contents/MacOS/grass/grass74", line 1697 sys.stdout.write("%s\n" % grass_version) ^ TabError: inconsistent use of tabs and spaces in indentation File "/Applications/QGIS3.app/Contents/MacOS/grass/grass74", line 1697 sys.stdout.write("%s\n" % grass_version) ^ TabError: inconsistent use of tabs and spaces in indentation

I have tried to look into the file grass74 and see if there is an issue with the indentation and fixed what seemed to be the issue but I am still getting the error...

help, please :)

Thanks, Charlotte

Philipp R
  • 598
  • 6
  • 22
CharlotteJ
  • 31
  • 1

2 Answers2

2

I just encountered the same error running v.clean on QGIS 3.4.2 on mac with grassgis64 and @David S. is right there are spaces used in the executable which should not be there. The fix is easy: Open grass74 in a text editor and replace the tabs by white spaces and it will run smoothly. I assume this is a bug on the development site requiring reporting.

orginal:

elif arg == 'version': [3 tabs ]sys.stdout.write("%s\n" % grass_version) else: message(_("Parameter <%s> not supported") % arg)

replace by:

elif arg == 'version': [12 white spaces]sys.stdout.write("%s\n" % grass_version) else: message(_("Parameter <%s> not supported") % arg)

Philipp R
  • 598
  • 6
  • 22
  • This was fixed in Dec 2018: https://github.com/OSGeo/grass/commit/bb2d070129bb810ad4a0f74dbc2c2ba8d0debc00 and is part of GRASS GIS 7.4.4 or later. Do you still use GRASS GIS 7.4.3? – markusN Jun 13 '19 at 19:40
1

If you still receive the same error message it means that you have tab characters and spaces: both being used for indentation. Your editor should have a command to convert all of your tabs to spaces or vice-versa. Sublime's typeahead menu calls the command "convert tabs to spaces". It should fix this error.

David S.
  • 730
  • 1
  • 7
  • 23