Opened 6 years ago
Closed 6 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 , 6 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 6 years ago
| Cc: | added |
|---|
comment:3 by , 6 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Version: | 3.0 → master |
comment:4 by , 6 years ago
| Needs tests: | unset |
|---|---|
| Patch needs improvement: | set |
comment:5 by , 6 years ago
| Owner: | changed from to |
|---|
comment:6 by , 6 years ago
I've fixed the patch. I'll leave it to someone else to confirm this patch is OK now.
comment:7 by , 6 years ago
| Patch needs improvement: | unset |
|---|
Patch confirmed as per https://github.com/django/django/pull/12467#issuecomment-590119787
I will write tests for the patch this week.