#2869 closed defect (fixed)
Default locale not found
Reported by: | pmav99 | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.0 |
Component: | Default | Version: | svn-trunk |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | Unspecified |
Description
I compiled GRASS on a docker container running Ubuntu 14.04.3. I am using trunk [67593] and I get the following traceback:
grassuser@c4219210d562:/usr/local/src$ grass WARNING: Default locale settings are missing. GRASS running with C locale. WARNING: Searched for a web browser, but none found Starting GRASS GIS... Traceback (most recent call last): File "/usr/bin/grass", line 1937, in <module> main() File "/usr/bin/grass", line 1834, in main grass_gui = check_gui(expected_gui=grass_gui) File "/usr/bin/grass", line 721, in check_gui p.stdin.write("variable=True".encode(ENCODING)) TypeError: encode() argument 1 must be string, not None
This is easily fixed by setting one of the relevant env variables, e.g.:
But since the documentation states that getdefaultlocale()
may return none, it might make sense to fallback to a default locale before giving up.
ENCODING = locale.getdefaultlocale()[1] or "utf-8"
If this is not desirable, then adding an explicit error message would certainly be more user friendly:
if ENCODING is None: sys.exit("Default locale not found ... ")
Change History (4)
comment:1 by , 9 years ago
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
grass.py looks way different in release branch, so I won't backport.
Note:
See TracTickets
for help on using tickets.
Could you try r67607? It should fallback to UTF-8 and print a message.