Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRASS gives python error if input layer path contains non ascii chars #15080

Closed
qgib opened this issue Apr 20, 2012 · 13 comments
Closed

GRASS gives python error if input layer path contains non ascii chars #15080

qgib opened this issue Apr 20, 2012 · 13 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS

Comments

@qgib
Copy link
Contributor

qgib commented Apr 20, 2012

Author Name: Pedro Costa (Pedro Costa)
Original Redmine Issue: 5420
Affected QGIS version: 2.4.0
Redmine category:processing/grass


Hello to all,

This is my first intervention here so i hope that i'm doing this right.
My versions are:

OS: Windows 7 64 bits
QGIS: 1.7.4 revision 411aff6
sextante 1.0.4

If I tried execute any grass algorithm like v.buffer, without any vector in the qgis project, the tool seems to be working well (like image '1'.
But if i have a shapefile open in the project give me a error (like the image '2') and I can't execute any tool.

Is very strange. Does anyone know the resolution? This only happen with grass algorithms.

Thanks


@qgib
Copy link
Contributor Author

qgib commented Apr 20, 2012

Author Name: Giovanni Manghi (@gioman)


Hi Pedro,

check also the sextante log and post any message that can be useful (of there is something more than the python error already attached).

@qgib
Copy link
Contributor Author

qgib commented Apr 20, 2012

Author Name: Pedro Costa (Pedro Costa)


Hi Giovanni,

I found the problem. If my shapes have in a directory named with special characters, like 'ã' or 'ç' gives me the error.
Only happen with some algorithms.

@qgib
Copy link
Contributor Author

qgib commented Apr 20, 2012

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from Grass give a python error to GRASS gives python error if input layer path contains non ascii chars

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2012

Author Name: Giovanni Manghi (@gioman)


this seems to be still true, the message is

Traceback (most recent call last):
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\core\GeoAlgorithm.py", line 117, in execute
self.processAlgorithm(progress)
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\grass\GrassAlgorithm.py", line 324, in processAlgorithm
self.consoleOutput = GrassUtils.executeGrass(commands, progress, outputCommands);
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\grass\GrassUtils.py", line 262, in executeGrass
command = GrassUtils.prepareGrassExecution(commands)
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\grass\GrassUtils.py", line 241, in prepareGrassExecution
GrassUtils.createGrassScript(commands)
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\grass\GrassUtils.py", line 167, in createGrassScript
output.write(command + "
")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 54: ordinal not in range(128)

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2012

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi Giovanni,

Confirmed also on Linux:

Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/sextante/core/GeoAlgorithm.py", line 117, in execute
    self.processAlgorithm(progress)
  File "/usr/share/qgis/python/plugins/sextante/grass/GrassAlgorithm.py", line 324, in processAlgorithm
    self.consoleOutput = GrassUtils.executeGrass(commands, progress, outputCommands);
  File "/usr/share/qgis/python/plugins/sextante/grass/GrassUtils.py", line 262, in executeGrass
    command = GrassUtils.prepareGrassExecution(commands)
  File "/usr/share/qgis/python/plugins/sextante/grass/GrassUtils.py", line 248, in prepareGrassExecution
    GrassUtils.createGrassBatchJobFileFromGrassCommands(commands)
  File "/usr/share/qgis/python/plugins/sextante/grass/GrassUtils.py", line 176, in createGrassBatchJobFileFromGrassCommands
    fout.write(command + "\
")
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xc1' in position 38: ordinal not in range(128)

Works fine if the same data is stored on a path without non ascii characters.

@qgib
Copy link
Contributor Author

qgib commented Oct 5, 2013

Author Name: Giovanni Manghi (@gioman)


still true on qgis 2.0.1

@qgib
Copy link
Contributor Author

qgib commented Mar 26, 2014

Author Name: Alexander Bruy (@alexbruy)


Should be fixed in 3d6f17b. Please test


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2014

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Closed

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Nicole Stoffels (Nicole Stoffels)


Still not working on qgis 2.4.0 (this qgis uses python 2.7.3, gcc 4.6.3). I have 64-bit linux machine with ubuntu 12.4.

As far as I can see, in the commit 3d6f17b 'open' is replaced by 'codecs.open' allowing utf-8 encoding. However, that does not fix the problem with non-ascii characters in the path.


  • assigned_to_id was changed from Victor Olaya to Giovanni Manghi
  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Giovanni Manghi (@gioman)


Nicole Stoffels wrote:

Still not working on qgis 2.4.0 (this qgis uses python 2.7.3, gcc 4.6.3). I have 64-bit linux machine with ubuntu 12.4.

As far as I can see, in the commit 3d6f17b 'open' is replaced by 'codecs.open' allowing utf-8 encoding. However, that does not fix the problem with non-ascii characters in the path.

It works fine here on the very same OS. You are probably using an old version of Processing. Check in ~./qgis2/pyhton/plugins

if there is a "processing" folder then delete it, close qgis and try again.


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2014

Author Name: Giovanni Manghi (@gioman)


  • project_id was changed from 78 to 17
  • category_id removed 59
  • version was configured as 2.4.0
  • crashes_corrupts_data was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2014

Author Name: Giovanni Manghi (@gioman)


  • category_id was configured as Processing/GRASS

@qgib
Copy link
Contributor Author

qgib commented Oct 11, 2014

Author Name: Giovanni Manghi (@gioman)


closing for lack of feedback, please reopen if necessary.


  • resolution was changed from to worksforme
  • status_id was changed from Feedback to Closed
  • assigned_to_id removed Giovanni Manghi

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS labels May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS
Projects
None yet
Development

No branches or pull requests

1 participant