Opened 6 years ago

Closed 6 years ago

#3641 closed defect (fixed)

python3/ctypes: ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_struct_Cell_head instance instead of LP_struct_Cell_head

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.8.0
Component: Python Version: unspecified
Keywords: Python3 ctypes Cc:
CPU: Unspecified Platform: Unspecified

Description

In a script using i.cutlines which in turn uses GridModule I suddenly get the following error using trunk:

Traceback (most recent call last):
  File "/home/mlennert/.grass7/addons/scripts/i.cutlines", line 673, in <module>
    main()
  File "/home/mlennert/.grass7/addons/scripts/i.cutlines", line 278, in main
    grd.run()
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/grid/grid.py", line 568, in run
    self.patch()
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/grid/grid.py", line 609, in patch
    self.start_row, self.start_col, self.out_prefix)
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/grid/patch.py", line 91, in rpatch_map
    rpatch_row(rast, rrasts, rbbox)
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/grid/patch.py", line 41, in rpatch_row
    sei = get_start_end_index(bboxes)
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/grid/patch.py", line 25, in get_start_end_index
    r_start, c_start = coor2pixel((bbox.west, bbox.north), reg)
  File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/utils.py", line 180, in coor2pixel
    return (libraster.Rast_northing_to_row(north, region.byref()),
ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_struct_Cell_head instance instead of LP_struct_Cell_head

I do not have this error with 7.6.

Change History (2)

comment:1 by annakrat, 6 years ago

I don't quite understand what exactly is going on, but there was a missing wrapper function which got lost during the porting and apparently it is needed. Try r73339.

in reply to:  1 comment:2 by mlennert, 6 years ago

Resolution: fixed
Status: newclosed

Replying to annakrat:

I don't quite understand what exactly is going on, but there was a missing wrapper function which got lost during the porting and apparently it is needed. Try r73339.

This seems to have fixed the issue. Thanks !

Note: See TracTickets for help on using tickets.