ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
125 stars 192 forks source link

Doesn't support python 3 #251

Closed filippzaripov closed 3 years ago

filippzaripov commented 3 years ago

I'm getting invalid syntax error when starting ckan. "except ValueError, e:" - this syntax is not correct in python 3, but there is no information in docs that plugin working only with python 2.

Possible solutions: Solution 1: fix syntax to "except ValueError as e:" Solution 2: mention in documentation that it's not working with python 3.

Traceback (most recent call last):
  File "/etc/ckan/default/wsgi.py", line 12, in <module>
    application = make_app(config)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
    load_environment(conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 123, in load_environment
    p.load_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 155, in load_all
    load(*plugins)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 169, in load
    service = _get_service(plugin)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 271, in _get_service
    return plugin.load()(name=plugin_name)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/src/ckanext-spatial/ckanext/spatial/plugin.py", line 113
    except ValueError, e:
                     ^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)
bonnland commented 3 years ago

I'm running into the same issue. I found this discussion on the migration to Python 3:

https://github.com/ckan/ckan/wiki/Python-3-migration-guide-for-extensions

See issue #238 also.

bonnland commented 3 years ago

Also just found #249

amercader commented 3 years ago

Python 3 support was added as part of #249. You can use the v1.0.0 tag onward to get Python 3 support.