Opened 5 years ago
Closed 3 years ago
#4015 closed defect (wontfix)
ctypes: TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | Python ctypes | Version: | git-releasebranch78 |
Keywords: | ctypes, python3 | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Alpine edge ships Python 3.8.1. When compiling GRASS 7.8 addons like i.cutlines (and other) addons, following error occurs:
Default locale settings are missing. GRASS running with C locale. Starting GRASS GIS... Creating new GRASS GIS location <tmploc>... Cleaning up temporary files... Executing <g.extension -s extension=i.cutlines> ... Fetching <i.cutlines> from GRASS GIS Addons repository (be patient)... Compiling... Traceback (most recent call last): File "/usr/lib/python3.8/ctypes/__init__.py", line 99, in CFUNCTYPE return _c_functype_cache[(restype, argtypes, flags)] KeyError: (<class 'ctypes.c_int'>, (<class 'grass.lib.ctypes_preamble.String'>,), 1) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/grass7-root-73/tmpumv5zbxd/i.cutlines/scripts/i.cutlines", line 171, in <module> from grass.pygrass.modules.grid.grid import GridModule File "/usr/local/grass78/etc/python/grass/pygrass/modules/grid/__init__.py", line 2, in <module> from grass.pygrass.modules.grid.grid import GridModule File "/usr/local/grass78/etc/python/grass/pygrass/modules/grid/grid.py", line 12, in <module> from grass.pygrass.gis import Mapset, Location File "/usr/local/grass78/etc/python/grass/pygrass/gis/__init__.py", line 13, in <module> import grass.lib.gis as libgis File "/usr/local/grass78/etc/python/grass/lib/gis.py", line 451, in <module> ('checker', CFUNCTYPE(UNCHECKED(c_int), String)), File "/usr/lib/python3.8/ctypes/__init__.py", line 101, in CFUNCTYPE class CFunctionType(_CFuncPtr): TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported. make: *** [/usr/local/grass78/include/Make/Html.make:14: i.cutlines.tmp.html] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. Execution of <g.extension -s extension=i.cutlines> finished. Cleaning up temporary files...
We used this docker image:
https://hub.docker.com/r/mundialis/grass-py3-pdal/tags
-> docker pull mundialis/grass-py3-pdal:stable-alpine
Change History (7)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Well, they will revert changes in 3.8.2 ... So it will work again with python 3.8.2 : https://github.com/python/cpython/pull/17960
follow-up: 4 comment:3 by , 5 years ago
Recompiling Python3.8.1 with this patch from pull/17960 (https://github.com/python/cpython/commit/eb9ba2f66df2195a9c6295e73ab3d545a1445f05.patch) looks promising until now...
follow-up: 5 comment:4 by , 5 years ago
Replying to carmenTawalika:
Recompiling Python3.8.1 with this patch from pull/17960 (https://github.com/python/cpython/commit/eb9ba2f66df2195a9c6295e73ab3d545a1445f05.patch) looks promising until now...
Great, thanks for figuring this out!
Python 3.7.6 and Python 3.8.0 are also affected and need to be patched.
follow-up: 6 comment:5 by , 5 years ago
Replying to mmetz:
Python 3.7.6 and Python 3.8.0 are also affected and need to be patched.
I have filed a bug report on Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1794572
Of course, other distros will face the same problem.
comment:6 by , 5 years ago
Replying to neteler:
Replying to mmetz:
Python 3.7.6 and Python 3.8.0 are also affected and need to be patched.
I have filed a bug report on Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1794572 Of course, other distros will face the same problem.
For the record:
- here the related Alpine Linux patch request: https://gitlab.alpinelinux.org/alpine/aports/merge_requests/3336
Hint for Fedora users: to downgrade to Python 3.7.4, just run dnf downgrade python
.
Hi,
Don't know if it's related but seems to have same error in archlinux. Build is fine but launching g.gui wxpython gives errors : All argtypes in gis.py return error. Using python 3.8.0 launch grass wxpython succesfully