Opened 12 years ago

Closed 7 years ago

#20036 closed Bug (fixed)

django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.4.0dev-CAPI-1.8.0 r0"

Reported by: chikiro.spam@… Owned by: nobody
Component: GIS Version: 1.5
Severity: Normal Keywords:
Cc: mmitar@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Can't use the module because version string of GEOS ends with "r0".

Change History (17)

comment:1 by chikiro.spam@…, 12 years ago

Is similar to #17212

comment:2 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 747f7d25490abc3d7fdb119f0ce3708d450eb4c2:

Fixed #20036 -- Improved GEOS version string parsing

Thanks chikiro.spam at gmail.com for the report.

comment:3 by Claude Paroz <claude@…>, 12 years ago

In 101ec4bf8aaf577c27ac9f11e52f4e604bc66c5a:

[1.5.x] Fixed #20036 -- Improved GEOS version string parsing

Thanks chikiro.spam at gmail.com for the report.
Backport of 747f7d254 from master.

comment:4 by Claude Paroz, 12 years ago

Component: UncategorizedGIS
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

in reply to:  3 comment:5 by anonymous, 11 years ago

Replying to Claude Paroz <claude@…>:

In 101ec4bf8aaf577c27ac9f11e52f4e604bc66c5a:

[1.5.x] Fixed #20036 -- Improved GEOS version string parsing

Thanks chikiro.spam at gmail.com for the report.
Backport of 747f7d254 from master.

can this be merged into 1.4 please?

comment:6 by Claude Paroz, 11 years ago

Sorry, but 1.4 is in security-fix only mode, no other fixes can go in.

comment:7 by pawciobiel@…, 11 years ago

Replying to claudep:

Sorry, but 1.4 is in security-fix only mode, no other fixes can go in.

AFAIK GEOS/GDAL has been updated due to vulnerability in one of their libs. Not fixing this will force 1.4 users to:
a) patch it manually (forces keeping 1.4 fork)
b) upgrade to 1.5 (forces gis upgrade)
c) use older and buggy GEOS/GDAL which leave them open to security issues

Also this supposed to be fixed in 1.3 #17212

Leaving 1.4 intentionally not fixed just doesn't sound right to me.

comment:8 by Claude Paroz, 11 years ago

#21244 has ben marked as a duplicate.

comment:9 by anonymous, 11 years ago

I preferred not to patch django so i "patched" geos lib. If you want to take this route, before doing brew install gdal, install geos using this recipe

https://gist.github.com/fission6/7619954

comment:10 by Mitar, 11 years ago

Cc: mmitar@… added

+1 for 1.4.

comment:11 by anonymous, 11 years ago

Django 1.4.10

  File "/Users/mau/.virtualenvs/newrunners/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py", line 115, in geos_version_info
    if not m: raise GEOSException('Could not parse version info string "%s"' % ver)
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.4.2-CAPI-1.8.2 r3921"

Patched by change lingoes.py

from

# Regular expression should be able to parse version strings such as
# '3.0.0rc4-CAPI-1.3.3', '3.0.0-CAPI-1.4.1' or '3.4.0dev-CAPI-1.8.0'
version_regex = re.compile(r'^(?P<version>(?P<major>\d+)\.(?P<minor>\d+)\.(?P<subminor>\d+))((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+)$')
def geos_version_info():

to

# Regular expression should be able to parse version strings such as
# '3.0.0rc4-CAPI-1.3.3', '3.0.0-CAPI-1.4.1' or '3.4.0dev-CAPI-1.8.0'
version_regex = re.compile(r'^(?P<version>(?P<major>\d+)\.(?P<minor>\d+)\.(?P<subminor>\d+))((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+).*$')
def geos_version_info():

comment:12 by Jordan Reiter, 10 years ago

Considering that Django 1.5 is now unsupported while 1.4.x is an LTS version, would it make sense to look into adding this relatively minor fix? Otherwise we are essentially requiring them to update not just one version number but (at least) 2.

comment:13 by Claude Paroz, 10 years ago

I've changed my mind about this, and agree it is a big annoyance, I'll backport the fix.

comment:14 by Claude Paroz <claude@…>, 10 years ago

In ba2be2761341a6b3d8d578f16c92fa278c0a42bc:

[1.4.x] Fixed #20036 -- Improved GEOS version string parsing

Thanks chikiro.spam at gmail.com for the report.

comment:15 by artscoop, 7 years ago

Still happens in probably every single version of Django from 1.6 at least up to 1.11.4, in Arch where the version is 3.6.2-CAPI-1.10.2 4d2925d6
The failure looks like this:

  File "/run/media/artscoop/.../lib/python3.6/site-packages/django/contrib/gis/geos/__init__.py", line 18, in <module>
    HAS_GEOS = geos_version_info()['version'] >= '3.3.0'
  File "/run/media/artscoop/.../lib/python3.6/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.6.2-CAPI-1.10.2 4d2925d6"

comment:16 by artscoop, 7 years ago

Resolution: fixed
Status: closednew

comment:17 by Simon Charette, 7 years ago

Resolution: fixed
Status: newclosed

Please avoid re-opening bugs closed for years.

This will be fixed in 1.11.5 which should be released this week. See #28441.

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