[GRASS-dev] [GRASS GIS] #2748: ctype.POINTER function overloading prevents automatic byref() conversion

GRASS GIS trac at osgeo.org
Sun Sep 20 03:34:40 PDT 2015


#2748: ctype.POINTER function overloading prevents automatic byref() conversion
----------------------------+-------------------------
  Reporter:  artegion       |      Owner:  grass-dev@…
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:
 Component:  Python ctypes  |    Version:  7.0.1
Resolution:                 |   Keywords:
       CPU:  Unspecified    |   Platform:  Unspecified
----------------------------+-------------------------

Comment (by glynn):

 Replying to [ticket:2748 artegion]:

 > grass.lib module overwrites ctype.POINTER function in ctypes_preamble
 module.

 The replacement POINTER function has the following comment:
 {{{
     # Convert None to a real NULL pointer to work around bugs
     # in how ctypes handles None on 64-bit platforms
 }}}
 Have you tested whether this is still an issue (it might have been fixed
 since ctypesgen was last updated)?

 Having to use byref() explicitly seems less of an issue than not working
 on 64-bit systems.

 Actually, if an argument is a pointer, the caller should probably be using
 byref() explicitly regardless of whether or not ctypes has a workaround.
 What's the problem with needing to use byref()?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2748#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list