Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#28441 closed Cleanup/optimization (fixed)

GEOS version parsing fails if it has a trailing hash

Reported by: vonabarak Owned by: nobody
Component: GIS Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Importing some classes (e.g. from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures) using libgeos.py causes GEOSException('Could not parse version info string "%s"' % ver) django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.6.2-CAPI-1.10.2 4d2925d6"
I have been investigated this problem a bit. The reason is probably wrong version_regex in line 182 of libgeos.py
Exactly part corresponding to parse commit id (or whatever means " 4d2925d6" in version_string)

Use django 1.11 on freebsd 11

Change History (15)

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedGIS
Has patch: set
Summary: Wrong parsing of GEOS library version string in "contrib/gis/geos/libgeos.py"GEOS version parsing fails if it has a trailing hash
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Hisham waleed karam, 7 years ago

the same error here django 1.8.18

Last edited 7 years ago by Hisham waleed karam (previous) (diff)

comment:3 by yardensachs, 7 years ago

4d2925d6 is the commit for 3.6.2 tagged on:
https://github.com/OSGeo/geos/tree/4d2925d6e0c758742a178053132eef02cd8374d2

So it looks like the commit hash was added to the version string.

And it looks like this is the commit that changed the version:
https://github.com/OSGeo/geos/commit/cc5e205e5b4c7d4ee567bf39a548e65ecf51dd0e
More specifically:
https://github.com/OSGeo/geos/commit/cc5e205e5b4c7d4ee567bf39a548e65ecf51dd0e#diff-8dd96440c9832c59176dcaa7c346b982

Hope this helps.

Last edited 7 years ago by yardensachs (previous) (diff)

comment:4 by Tim Graham, 7 years ago

I guess we should fix this on 1.11.x so we don't block the use of newer versions of GEOS there. PR for stable/1.11.x

comment:5 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 78c155c:

Fixed #28441 -- Fixed GEOS version parsing with a commit hash at the end.

comment:6 by Tim Graham <timograham@…>, 7 years ago

In a49764dd:

[1.11.x] Fixed #28441 -- Fixed GEOS version parsing with a commit hash at the end.

A less invasive backport of 78c155cf2e5a27fd2db18c2d46953b1b0fdba829
from master

comment:7 by Johannes Maron, 7 years ago

Is this scheduled to be released soon?

If anyone has this issue on macOS and does not know how to solve it, this should do the trick:

brew switch geos 3.6.1

comment:8 by Tim Graham, 7 years ago

Bug fix releases happen monthly, usually on the first of the month.

comment:9 by will, 7 years ago

Resolution: fixed
Status: closednew

I met this kind of problem in Mac OS 10.12.6, django version 1.11.4.
My geos version is 3.6.2. I installed the plugins using brew.

comment:10 by yardensachs, 7 years ago

Resolution: fixed
Status: newclosed

This was fixed in 1.11.5 (which will be released this week).

Last edited 7 years ago by Tim Graham (previous) (diff)

comment:11 by Rudolph Froger, 7 years ago

Resolution: fixed
Status: closednew

Please also fix this in Django 1.8.

comment:12 by Simon Charette, 7 years ago

Resolution: fixed
Status: newclosed

Rudolph, please take the time to read our backporting policy to understand why this wasn't backported to 1.8 before re-opening a closed ticket.

At this point, and when this ticket was reported as well, only security fixes and data loss bug qualify for a 1.8 backport.

comment:13 by Nikolas N, 5 years ago

I'm running into this problem in Django 1.11.25, Debian testing/bullseye:

  File "/home/nik/src/d/blackrock/ve/lib/python3.7/site-packages/django/contrib/gis/geos/libgeos.py", line 196, in geos_version
_info
    raise GEOSException('Could not parse version info string "%s"' % ver)
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.8.0-CAPI-1.13.1 "

comment:14 by Mariusz Felisiak, 5 years ago

Nikolas, thanks for this report, however Django 1.11 doesn't receive bugfixes anymore (it is in extended support).

in reply to:  13 comment:15 by Kirill Malyshev, 5 years ago

Replying to Nikolas Nyby:

Had same issue today. Resolved by downgrading geos to 3.7.2 and gdal to 3.0.1.

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