[Django] #31292: Calling gdal_full_version() is broken on Python 3

45 views
Skip to first unread message

Django

unread,
Feb 20, 2020, 3:17:20 PM2/20/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------------------+------------------------
Reporter: Diederik van der Boor | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31292>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 21, 2020, 3:49:35 AM2/21/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: nobody
Boor |

Type: Bug | Status: new
Component: GIS | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* needs_tests: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:1>

Django

unread,
Feb 21, 2020, 4:28:55 AM2/21/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: nobody
Boor |
Type: Bug | Status: new
Component: GIS | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* cc: Hasan Ramezani (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:2>

Django

unread,
Feb 22, 2020, 5:01:02 AM2/22/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner:
Boor | taylorjohnwood
Type: Bug | Status: assigned
Component: GIS | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by taylorjohnwood):

* owner: nobody => taylorjohnwood
* status: new => assigned
* version: 3.0 => master


Comment:

I will write tests for the patch this week.

--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:3>

Django

unread,
Feb 22, 2020, 3:38:54 PM2/22/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Taylor
Boor | John Wood

Type: Bug | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* needs_better_patch: 0 => 1
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:4>

Django

unread,
Feb 22, 2020, 3:40:18 PM2/22/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Diederik
Boor | van der Boor

Type: Bug | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: Taylor John Wood => Diederik van der Boor


--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:5>

Django

unread,
Feb 23, 2020, 5:06:52 PM2/23/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Diederik
Boor | van der Boor
Type: Bug | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Diederik van der Boor):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:6>

Django

unread,
Feb 24, 2020, 6:26:47 AM2/24/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Diederik
Boor | van der Boor
Type: Bug | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Diederik van der Boor):

* needs_better_patch: 1 => 0


Comment:

Patch confirmed as per
https://github.com/django/django/pull/12467#issuecomment-590119787

--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:7>

Django

unread,
Feb 24, 2020, 7:51:41 AM2/24/20
to django-...@googlegroups.com
#31292: Calling gdal_full_version() is broken on Python 3
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Diederik
Boor | van der Boor
Type: Bug | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"84e35f4679622bf6cf7c1763bee3ce9af9c892ff" 84e35f46]:
{{{
#!CommitTicketReference repository=""
revision="84e35f4679622bf6cf7c1763bee3ce9af9c892ff"
Fixed #31292 -- Fixed django.contrib.gis.gdal.gdal_full_version() crash.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31292#comment:8>

Reply all
Reply to author
Forward
0 new messages