summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-08-01 15:06:31 -0400
committerTim Graham <timograham@gmail.com>2017-08-02 09:46:52 -0400
commita49764dd9daa11c4e24bad84423f71711b3e0de0 (patch)
tree49adea9e4aa30d469f9e85aca08d34533a221a45
parent2ec74bfcaccd533ed9684c88f734ba3765866a95 (diff)
[1.11.x] Fixed #28441 -- Fixed GEOS version parsing with a commit hash at the end.
A less invasive backport of 78c155cf2e5a27fd2db18c2d46953b1b0fdba829 from master
-rw-r--r--django/contrib/gis/geos/libgeos.py2
-rw-r--r--docs/releases/1.11.5.txt3
-rw-r--r--tests/gis_tests/geos_tests/test_geos.py3
3 files changed, 5 insertions, 3 deletions
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
index 48532d5c53..2257061ed7 100644
--- a/django/contrib/gis/geos/libgeos.py
+++ b/django/contrib/gis/geos/libgeos.py
@@ -179,7 +179,7 @@ geos_version = GEOSFuncFactory('GEOSversion', restype=c_char_p)
# '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+)?$'
+ r'((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+)( r\d+)?( \w+)?$'
)
diff --git a/docs/releases/1.11.5.txt b/docs/releases/1.11.5.txt
index bbdd640e4b..55fa0eda7e 100644
--- a/docs/releases/1.11.5.txt
+++ b/docs/releases/1.11.5.txt
@@ -9,4 +9,5 @@ Django 1.11.5 fixes several bugs in 1.11.4.
Bugfixes
========
-* ...
+* Fixed GEOS version parsing if the version has a commit hash at the end (new
+ in GEOS 3.6.2) (:ticket:`28441`).
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py
index 554f1e8117..60ceeffdcc 100644
--- a/tests/gis_tests/geos_tests/test_geos.py
+++ b/tests/gis_tests/geos_tests/test_geos.py
@@ -1278,7 +1278,8 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
versions = [('3.0.0rc4-CAPI-1.3.3', '3.0.0', '1.3.3'),
('3.0.0-CAPI-1.4.1', '3.0.0', '1.4.1'),
('3.4.0dev-CAPI-1.8.0', '3.4.0', '1.8.0'),
- ('3.4.0dev-CAPI-1.8.0 r0', '3.4.0', '1.8.0')]
+ ('3.4.0dev-CAPI-1.8.0 r0', '3.4.0', '1.8.0'),
+ ('3.6.2-CAPI-1.10.2 4d2925d6', '3.6.2', '1.10.2')]
for v_init, v_geos, v_capi in versions:
m = version_regex.match(v_init)
self.assertTrue(m, msg="Unable to parse the version string '%s'" % v_init)