Opened 2 years ago

Closed 2 years ago

Last modified 8 months 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 (14)

comment:1 Changed 2 years ago by chikiro.spam@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Is similar to #17212

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

  • Resolution set to fixed
  • Status changed from new to closed

In 747f7d25490abc3d7fdb119f0ce3708d450eb4c2:

Fixed #20036 -- Improved GEOS version string parsing

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

comment:3 follow-up: Changed 2 years ago by 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.

comment:4 Changed 2 years ago by claudep

  • Component changed from Uncategorized to GIS
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

comment:5 in reply to: ↑ 3 Changed 20 months ago by anonymous

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 Changed 20 months ago by claudep

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

comment:7 Changed 20 months ago by pawciobiel@…

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 Changed 20 months ago by claudep

#21244 has ben marked as a duplicate.

comment:9 Changed 18 months ago by anonymous

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 Changed 17 months ago by mitar

  • Cc mmitar@… added

+1 for 1.4.

comment:11 Changed 17 months ago by anonymous

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 Changed 8 months ago by JordanReiter

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 Changed 8 months ago by claudep

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

comment:14 Changed 8 months ago by Claude Paroz <claude@…>

In ba2be2761341a6b3d8d578f16c92fa278c0a42bc:

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

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

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