5

I have the following error message every time I try to run a GRASS algorithm in QGIS 3.4. I unistalled the software and installed it again but I did not solve anything.

Traceback (most recent call last):
File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Algorithm.py", line 415, in processAlgorithm
Grass7Utils.executeGrass(self.commands, feedback, self.outputCommands)
File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Utils.py", line 372, in executeGrass
for line in iter(proc.stdout.readline, ''):
File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 50: invalid continuation byte
  • Similar topic Error using v.clean – Taras Nov 13 '18 at 14:24
  • I was experiencing the same issue. Luckily, the answer provided by Mike worked for me. Thanks! – Friedemann Nov 22 '18 at 13:54
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – Hornbydd Nov 22 '18 at 14:41
4

Try adjusting the file: ..\apps\qgis\python\plugins\processing\algs\grass7\Grass7Utils.py at line 370:

        startupinfo=si if isWindows() else None,
        encoding = 'cp850' if isWindows() else None # new encoding for DOS
) as proc:

400:

            startupinfo=si if isWindows() else None,
            encoding = 'cp850' if isWindows() else None # new encoding for DOS
    ) as proc:

Background: The console (stdout, stderr) speaks "DOS". An MSDOS non ASCII char in the output causes the code to crash.

Note: In https://github.com/qgis/QGIS/tree/master/python/plugins/processing/algs/grass7 there is a new Version. If also an "decode" error occurs in the new version, it is probably due to a faulty GRASS installation. Check the grass74.bat file.

  • I'm not encountering an error anymore, after adjusting the code. But know QGIS gets stuck. Always after the logfile says: "No attribute table was found [...] x features without category were written". Even though an attribute table exists and it also happens with different inputs. – gHupf Nov 14 '18 at 8:32
  • Try my new Adaptation´. You can also try the new Version on github.com/qgis/QGIS/tree/master/python/plugins/processing/algs/…. – Mike Nov 14 '18 at 11:00
  • Now the processing plugin can't be loaded due to a syntax error. I think it points to the word encoding. – gHupf Nov 14 '18 at 14:29
  • Is there a ticket tracking this issue? – Gnafu Nov 16 '18 at 9:17
  • yes please, create also a QGIS issue we can't rely on a third party platform as stackexchange the trace of a bugfix – Luigi Pirelli Nov 20 '18 at 21:10
1

QGIS version 3.4.2:

The new QGIS version 3.4.2 fixes this bug. You should not encounter any more error messages.

Note: This only works since QGIS version 3.4.2, if you use a previous version of 3.x please update QGIS or check the other answer(s) for possible workarounds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.