Opened 5 years ago

Closed 5 years ago

#31292 closed Bug (fixed)

Calling gdal_full_version() is broken on Python 3

Reported by: Diederik van der Boor Owned by: Diederik van der Boor
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Hasan Ramezani Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The GDAL _version_info() ctypes call uses a c_char_p type as first argument. In the Python-3 port (5330cd50cdb0674cd08cbfb40af9ac51267fbbec) the gdal_version() was updated to reflect that, but the gdal_full_version() function below was missed. It currently raises the following error:

ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

The solution is simply to call gdal's _version_info() with a bytes value too.
The PR https://github.com/django/django/pull/12467 fixes that.

Change History (8)

comment:1 by Claude Paroz, 5 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Hasan Ramezani, 5 years ago

Cc: Hasan Ramezani added

comment:3 by Taylor John Wood, 5 years ago

Owner: changed from nobody to Taylor John Wood
Status: newassigned
Version: 3.0master

I will write tests for the patch this week.

comment:4 by Hasan Ramezani, 5 years ago

Needs tests: unset
Patch needs improvement: set

comment:5 by Hasan Ramezani, 5 years ago

Owner: changed from Taylor John Wood to Diederik van der Boor

comment:6 by Diederik van der Boor, 5 years ago

I've fixed the patch. I'll leave it to someone else to confirm this patch is OK now.

comment:7 by Diederik van der Boor, 5 years ago

Patch needs improvement: unset

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 84e35f46:

Fixed #31292 -- Fixed django.contrib.gis.gdal.gdal_full_version() crash.

Note: See TracTickets for help on using tickets.
Back to Top