Bug#935887: python3-mapproxy: Change default template_dir and fix capabilities for Python >= 3.6.7
Marek Lukács
marek.lukacs at gmail.com
Tue Aug 27 10:52:42 BST 2019
Package: python3-mapproxy
Version: 1.11.0-3
Severity: grave
Tags: patch d-i upstream
Justification: renders package unusable
MapProxy does not work on Python 3.7 installs. I figured out two issues,
one related to Debian installation (directory structure) and other to
upstream known issue:
1. Directory structure
Debian moves templates into /usr/share/python3-mapproxy/, but default
template_dir variable is not changed, so Python looks for templates
instead in /usr/lib/python3/dist-packages/mapproxy/.
How to fix:
change default directory in
/usr/lib/python3/dist-packages/mapproxy/config/defaults.py
2. Upstream code is not compatible with Python 3.7
Tempia does not correctly parses function signature with recent Python
versions. Likely introduced with changes in Python tokenizer package
with 3.6.7. Use keyword args as workaround.
This is already known bug in upstream:
https://github.com/mapproxy/mapproxy/commit/81c84d47bbc77da324c36ca718fbca7dde1c1c66
How to fix:
Patch according to commit
https://github.com/mapproxy/mapproxy/commit/81c84d47bbc77da324c36ca718fbca7dde1c1c66
Both issues can be fixed by following patch. The issue (1) has to be
checked on Python 2.7 release, as the word 'python3' is in the path and
I wonder, if in Python 2.7 release it is not only 'python'.
-- PATCH BEGIN --
diff -ur orig/usr/lib/python3/dist-packages/mapproxy/config/defaults.py pack/usr/lib/python3/dist-packages/mapproxy/config/defaults.py
--- orig/usr/lib/python3/dist-packages/mapproxy/config/defaults.py 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3/dist-packages/mapproxy/config/defaults.py 2019-08-27 11:08:33.876870762 +0200
@@ -52,7 +52,7 @@
log_conf = 'log.ini'
# directory with mapproxy/service/templates/* files
-template_dir = None
+template_dir = '/usr/share/python3-mapproxy/service/templates'
cache = dict(
base_dir = './cache_data',
diff '--color=auto' -ur orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms100capabilities.xml pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms100capabilities.xml
--- orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms100capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms100capabilities.xml 2019-08-27 10:51:31.792753187 +0200
@@ -66,7 +66,7 @@
</Format>
</Exception>
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms110capabilities.xml pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms110capabilities.xml
--- orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms110capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms110capabilities.xml 2019-08-27 10:51:59.520757176 +0200
@@ -101,7 +101,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms111capabilities.xml pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms111capabilities.xml
--- orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms111capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms111capabilities.xml 2019-08-27 10:52:23.824760688 +0200
@@ -113,7 +113,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms130capabilities.xml pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms130capabilities.xml
--- orig/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms130capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.6/dist-packages/mapproxy/service/templates/wms130capabilities.xml 2019-08-27 10:53:27.812770013 +0200
@@ -196,7 +196,7 @@
{{endif}}
</inspire_vs:ExtendedCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
{{py: md = bunch(default='', **layer.md)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
diff '--color=auto' -ur orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms100capabilities.xml pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms100capabilities.xml
--- orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms100capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms100capabilities.xml 2019-08-27 10:51:31.792753187 +0200
@@ -66,7 +66,7 @@
</Format>
</Exception>
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms110capabilities.xml pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms110capabilities.xml
--- orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms110capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms110capabilities.xml 2019-08-27 10:51:59.520757176 +0200
@@ -101,7 +101,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms111capabilities.xml pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms111capabilities.xml
--- orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms111capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms111capabilities.xml 2019-08-27 10:52:23.824760688 +0200
@@ -113,7 +113,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms130capabilities.xml pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms130capabilities.xml
--- orig/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms130capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/lib/python3.7/dist-packages/mapproxy/service/templates/wms130capabilities.xml 2019-08-27 10:53:27.812770013 +0200
@@ -196,7 +196,7 @@
{{endif}}
</inspire_vs:ExtendedCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
{{py: md = bunch(default='', **layer.md)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
diff '--color=auto' -ur orig/usr/share/python3-mapproxy/service/templates/wms100capabilities.xml pack/usr/share/python3-mapproxy/service/templates/wms100capabilities.xml
--- orig/usr/share/python3-mapproxy/service/templates/wms100capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/share/python3-mapproxy/service/templates/wms100capabilities.xml 2019-08-27 10:51:31.792753187 +0200
@@ -66,7 +66,7 @@
</Format>
</Exception>
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/share/python3-mapproxy/service/templates/wms110capabilities.xml pack/usr/share/python3-mapproxy/service/templates/wms110capabilities.xml
--- orig/usr/share/python3-mapproxy/service/templates/wms110capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/share/python3-mapproxy/service/templates/wms110capabilities.xml 2019-08-27 10:51:59.520757176 +0200
@@ -101,7 +101,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/share/python3-mapproxy/service/templates/wms111capabilities.xml pack/usr/share/python3-mapproxy/service/templates/wms111capabilities.xml
--- orig/usr/share/python3-mapproxy/service/templates/wms111capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/share/python3-mapproxy/service/templates/wms111capabilities.xml 2019-08-27 10:52:23.824760688 +0200
@@ -113,7 +113,7 @@
</VendorSpecificCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
{{if layer.name}}
<Name>{{ layer.name }}</Name>
diff '--color=auto' -ur orig/usr/share/python3-mapproxy/service/templates/wms130capabilities.xml pack/usr/share/python3-mapproxy/service/templates/wms130capabilities.xml
--- orig/usr/share/python3-mapproxy/service/templates/wms130capabilities.xml 2017-11-20 13:25:56.000000000 +0100
+++ pack/usr/share/python3-mapproxy/service/templates/wms130capabilities.xml 2019-08-27 10:53:27.812770013 +0200
@@ -196,7 +196,7 @@
{{endif}}
</inspire_vs:ExtendedCapabilities>
{{endif}}
-{{def layer_capabilities(layer, with_srs)}}
+{{def layer_capabilities(layer, with_srs=False)}}
{{py: md = bunch(default='', **layer.md)}}
<Layer{{if layer.queryable}} queryable="1"{{endif}}>
-- PATCH END --
-- System Information:
Debian Release: 10.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-5-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-mapproxy depends on:
ii fonts-dejavu-core 2.37-1
ii python3 3.7.3-1
ii python3-pil 5.4.1-2
ii python3-pkg-resources 40.8.0-1
ii python3-pyproj 1.9.6-1
ii python3-yaml 3.13-2
Versions of packages python3-mapproxy recommends:
ii python3-boto3 1.9.86-1
ii python3-botocore 1.12.103+repack-1
ii python3-gdal 2.4.0+dfsg-1+b1
ii python3-lxml 4.3.2-1
ii python3-pastedeploy 2.0.1-1
ii python3-redis 3.2.1-2
ii python3-shapely 1.6.4-2
python3-mapproxy suggests no packages.
-- no debconf information
More information about the Pkg-grass-devel
mailing list