SyntaxError with older Python version
When running Ceyx, I'm encountering this error:
Traceback (most recent call last): File "./osm2png.py", line 307, in <module> osm2svg.render(size, height, outfilepath= outfile) File "./osm2png.py", line 114, in render png = renderer.render_png(self.osmparser, self.zoom, width, height) File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 676, in render_png self.render_layer(base_layer) File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 602, in render_layer self.render_way(ele, rules, z_index, ctx) File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 370, in render_way way_ele = self.osmparser.root.find("way[@id='%s']" % wayid) File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 330, in find return ElementPath.find(self, path) File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 186, in find return _compile(path).find(element) File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 176, in _compile p = Path(path) File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 93, in __init__ "expected path separator (%s)" % (op or tag) SyntaxError: expected path separator ([)
I'm getting this on a machine with Python 2.6.6 (from the Ubuntu 10.10 repositories), whereas 2.7.2 works fine. A bit of experimentation shows that the error is triggered for a way that is missing in a relation. With the newer version, Ceyx will print "WARNING: Missing way 39613023 in relation. Dropping relation" in this situation. It seems that etree, where the exception occurs, has a different version (1.2.6 vs. 1.3.0) in the different Python versions, which might cause the different behaviour.
Am I doing anything wrong or does Ceyx need Python >= 2.7, rather than >= 2.5 as stated in the instructions? --Tordanik 06:53, 3 December 2011 (UTC)