Opened 6 years ago

Closed 6 years ago

#3777 closed defect (fixed)

vector digitizer crashes with python 3

Reported by: veroandreo Owned by: martinl
Priority: normal Milestone: 7.8.0
Component: wxGUI Version: svn-trunk
Keywords: vector digitizer, python3 Cc: grass-dev@…
CPU: Unspecified Platform: Linux

Description

When changing to vector digitizer mode in Map Display and attempting to create a new vector map to start digitizing, it crashes and I get the following in the GUI Console tab:

Traceback (most recent call last):
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/vdigit/toolbars.py", line 818, in
OnSelectMap

disableAdd=True)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/gui_core/dialogs.py", line 520, in
CreateNewVector

stdin=sql)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/core/gcmd.py", line 719, in
RunCommand

ps.stdin.write(stdin)
TypeError
:
a bytes-like object is required, not 'str'

I use trunk r74162 in a virtualenv with python3.

Change History (8)

comment:1 by veroandreo, 6 years ago

This is still an issue in r74400 compiled and run in a virtualenv with python3. If trunk is compiled with python2 as usual, it works as expected.

comment:2 by veroandreo, 6 years ago

The error points to slightly different lines:

Traceback (most recent call last):
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/vdigit/toolbars.py", line 817, in
OnSelectMap

disableAdd=True)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/gui_core/dialogs.py", line 524, in
CreateNewVector

stdin=sql)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/core/gcmd.py", line 719, in
RunCommand

ps.stdin.write(stdin)
TypeError
:
a bytes-like object is required, not 'str'

comment:3 by martinl, 6 years ago

In 74401:

vector digitizer crashes with python 3, see #3777

comment:4 by martinl, 6 years ago

Hopefully fixed in r74401

comment:5 by martinl, 6 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned

comment:6 by veroandreo, 6 years ago

Just re-compiled and tested. Now, it does not crash, but the dialog to submit each new feature does not appear and cat is not written. v.db.select of new vector digitized is empty.

This is what I get in the GUI console when digitizing polygons:

Traceback (most recent call last):
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1397, in
MouseActions

self.OnRightUp(event)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1644, in
OnRightUp

self._onRightUp(event)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/vdigit/mapwindow.py", line 1001, in
_onRightUp

action="add", ignoreError=True)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/dbmgr/dialogs.py", line 119, in
__init__

self.UpdateDialog(query=query, cats=cats)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/dbmgr/dialogs.py", line 442, in
UpdateDialog

self.fid = self.cats.keys()[0]
TypeError
:
'dict_keys' object is not subscriptable
Traceback (most recent call last):
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1397, in
MouseActions

self.OnRightUp(event)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1644, in
OnRightUp

self._onRightUp(event)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/vdigit/mapwindow.py", line 1001, in
_onRightUp

action="add", ignoreError=True)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/dbmgr/dialogs.py", line 119, in
__init__

self.UpdateDialog(query=query, cats=cats)
  File
"/home/veroandreo/software/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/dbmgr/dialogs.py", line 442, in
UpdateDialog

self.fid = self.cats.keys()[0]
TypeError
:
'dict_keys' object is not subscriptable

in reply to:  7 comment:8 by veroandreo, 6 years ago

Resolution: fixed
Status: assignedclosed

Replying to martinl:

See https://github.com/OSGeo/grass/pull/13

Thanks! It works as expected now, closing.

Note: See TracTickets for help on using tickets.