-
-
Notifications
You must be signed in to change notification settings - Fork 412
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
I want to use GRASS in a python module but get some errors when using certain functions of the grass.script.setup module.
To Reproduce
Connect to a grass mapset in python as described in the docs, e.g.
import grass.script.setup as gsetup
rcfile = gsetup.init('my_db', 'my_location', 'my_mapset')
rcfile.finish()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/grass82/etc/python/grass/script/setup.py", line 415, in finish
finish()
File "/usr/local/grass82/etc/python/grass/script/setup.py", line 474, in finish
clean_default_db()
File "/usr/local/grass82/etc/python/grass/script/setup.py", line 434, in clean_default_db
gcore.message(_("Cleaning up default sqlite database ..."))
TypeError: 'str' object is not callableSystem description (please complete the following information):
Tested on two Linux systems with GRASS 7.8 and GRASS 8.2 using python 3.6.2 and 3.9.10, respectively.
Additional context
Error is caused by gcore.message(_("<message>")) calls in setup.py. I think #551 is related where the issue was discussed but never really solved.
For the time being a workaround works for my case with gutils.try_remove(os.environ["GISRC"]) which is basically what I need here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working