[GRASS-dev] [GRASS GIS] #3133: v.what output is not valid JSON format

GRASS GIS trac at osgeo.org
Sun Aug 21 03:14:13 PDT 2016


#3133: v.what output is not valid JSON format
-------------------------+-------------------------
 Reporter:  marisn       |      Owner:  grass-dev@…
     Type:  defect       |     Status:  new
 Priority:  normal       |  Milestone:  7.3.0
Component:  wxGUI        |    Version:  svn-trunk
 Keywords:  v.what       |        CPU:  Unspecified
 Platform:  Unspecified  |
-------------------------+-------------------------
 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 at 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,"}}]}]}
 }}}

 {{{

 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3133>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list