Opened 8 years ago
Closed 8 years ago
#3133 closed defect (fixed)
v.what output is not valid JSON format
| Reported by: | marisn | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.5 |
| Component: | Vector | Version: | svn-trunk |
| Keywords: | v.what | Cc: | |
| CPU: | Unspecified | Platform: | Unspecified |
Description
It seems that wxGUI vector attribute query tool is parsing text attribute values - "\" character is used as an escape character instead of its literal value. Thus \' will cause "invalid JSON" error, \b will render a backspace, \ \ (double backslash) will render as a single \ symbol.
v.db.select map=rm_me@user1 cat|title 1|\'foo, 2|ba'\'r 3|ba' 4|ba'\b'r 5|ba\\'r
File "/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-gnu/gui/wxpython/mapdisp/frame.py", line 963, in QueryMap
distance=qdist, encoding=encoding)
File "/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/script/vector.py", line 395, in vector_what
raise ScriptError(_("v.what output is not valid JSON format:\n {ret}").format(ret=ret))
ScriptError: v.what output is not valid JSON format:
{"Coordinates": {"East": "18.484321", "North": "9.264808"},
"Maps":
[{"Map": "rm_me",
"Mapset": "user1",
"Type": "Point",
"Id": 1,
"Categories": [
{"Layer": 1, "Category": 1,
"Driver": "sqlite",
"Database": "/home/maris/grass_data/nc_basic_spm_grass7/user1/sqlite/sqlite.db",
"Table": "rm_me",
"Key_column": "cat",
"Attributes": {"cat": "1",
"title": "\'foo,"}}]}]}
Change History (5)
comment:1 by , 8 years ago
comment:5 by , 8 years ago
| Component: | wxGUI → Vector |
|---|---|
| Milestone: | 7.4.0 → 7.0.5 |
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

In 69178: