#17212 closed Bug (fixed)
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.4.0dev-CAPI-1.8.0"
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | GIS | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Can't use the module with a development version of GEOS, due the version string parser chocking.
File "/home/strk/.virtualenvs/qgis_django/lib/python2.6/site-packages/django/contrib/gis/geos/libgeos.py", line 113, in geos_version_info
Actual version is 1.3.1-final
Attachments (1)
Change History (10)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Has patch: | set |
---|
comment:3 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
Looks good to me.
Generally, each patch must include tests, but in this case, I sounds overkill. I'll defer to the GIS maintainer to decide.
comment:4 by , 13 years ago
Patch needs improvement: | set |
---|
Note that you should generate your patch from the "trunk" directory to avoid ambiguities.
comment:6 by , 11 years ago
Hi, I have this problem from my ArchLinux last update:
GEOSException: Could not parse version info string "3.4.2-CAPI-1.8.2 r3921"
My "solution" was edit the geos_version_info function changing this line:
ver = geos_version().decode()
with this line:
ver = geos_version().decode().split(' ')[0]
Thanks!
comment:7 by , 11 years ago
We have improved once again the parsing in #20036, which is in the latest 1.5 stable version and up.
comment:9 by , 11 years ago
Here's a patch you should be able to manually apply to 1.4:
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py index f011208..05e5d12 100644 --- a/django/contrib/gis/geos/libgeos.py +++ b/django/contrib/gis/geos/libgeos.py @@ -108,8 +108,11 @@ def get_pointer_arr(n): geos_version.restype = c_char_p # 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+)$') +# '3.0.0rc4-CAPI-1.3.3', '3.0.0-CAPI-1.4.1', '3.4.0dev-CAPI-1.8.0' or '3.4.0dev-CAPI-1.8.0 r0' +version_regex = re.compile( + r'^(?P<version>(?P<major>\d+)\.(?P<minor>\d+)\.(?P<subminor>\d+))' + r'((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+)( r\d+)?$' +) def geos_version_info(): """ Returns a dictionary containing the various version metadata parsed from
For the record, here's my string: "3.4.0dev-CAPI-1.8.0"