Opened 9 years ago
Closed 6 years ago
#2886 closed defect (worksforme)
v.import/r.import: UnicodeEncodeError when path contains special characters
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.7 |
Component: | Default | Version: | svn-trunk |
Keywords: | v.import r.import encoding | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Trying to importing a file that resides in a path with special characters (accent in this case), I get the following errors.
In trunk:
> v.import input=/home/mlennert/Données/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp output=countries Traceback (most recent call last): File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/scripts/v.import", line 284, in <module> options, flags = grass.parser() File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 719, in parser cmdline += [b'"' + encode(arg) + b'"' for arg in sys.argv[1:]] File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/script/utils.py", line 174, in encode return string.encode(enc) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)
In release70:
> v.import input=/home/mlennert/Données/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp output=countries Traceback (most recent call last): File "/home/mlennert/SRC/GRASS/grass70_release/dist.x86_64-pc-linux-gnu/scripts/v.import", line 273, in <module> sys.exit(main()) File "/home/mlennert/SRC/GRASS/grass70_release/dist.x86_64-pc-linux-gnu/scripts/v.import", line 158, in main f.write('GISDBASE: %s\n' % GISDBASE) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 29: ordinal not in range(128)
I get exactly the same errors with r.import.
Change History (6)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:4 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:5 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:6 by , 6 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Replying to mlennert:
Correction: in release70 the below error is due to GISDBASE containing an accent, not because of the file path. When GISDBASE does not contain an accent, below import works, even if the path to the imported file contains an accent.