Sunday, 15 March 2015

pyramid - Syntax error in a Python library, and I'm not sure how to proceed -



pyramid - Syntax error in a Python library, and I'm not sure how to proceed -

i'm using pyramid 1.5.1 , python 3.2, , added quite bit of code , couple libraries project.

on running development.ini, i'm getting error below.

if had take wild guess, particular library (looks markupsafe?) isn't compatible python3...but project page seems indicate is. problem is, i'm not calling library directly, it's beingness used library hard replace.

i'm new python programming, , wondering options here or best way debug is?

(finance-env)user1@finance1:/var/www/finance/corefinance/corefinance$ /var/www/finance/finance-env/bin/pserve /var/www/finance/corefinance/development.ini --reload starting subprocess file monitor traceback (most recent phone call last): file "/var/www/finance/finance-env/bin/pserve", line 9, in <module> load_entry_point('pyramid==1.5.1', 'console_scripts', 'pserve')() file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 51, in main homecoming command.run() file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 316, in run global_conf=vars) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 340, in loadapp homecoming loadapp(app_spec, name=name, relative_to=relative_to, **kw) file "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp homecoming loadobj(app, uri, name=name, **kw) file "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj homecoming context.create() file "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 710, in create homecoming self.object_type.invoke(self) file "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke homecoming fix_call(context.object, context.global_conf, **context.local_conf) file "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/util.py", line 55, in fix_call val = callable(*args, **kw) file "/var/www/finance/corefinance/corefinance/__init__.py", line 35, in main session_factory=session_factory file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 301, in __init__ exceptionresponse_view=exceptionresponse_view, file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 412, in setup_registry self.include(inc) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 755, in include c(configurator) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid_debugtoolbar-2.1-py3.2.egg/pyramid_debugtoolbar/__init__.py", line 113, in includeme config.include('pyramid_mako') file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 727, in include c = self.maybe_dotted(callable) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 825, in maybe_dotted homecoming self.name_resolver.maybe_resolve(dotted) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 320, in maybe_resolve homecoming self._resolve(dotted, package) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 327, in _resolve homecoming self._zope_dottedname_style(dotted, package) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 370, in _zope_dottedname_style found = __import__(used) file "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid_mako-1.0.2-py3.2.egg/pyramid_mako/__init__.py", line 18, in <module> mako.lookup import templatelookup file "/var/www/finance/finance-env/lib/python3.2/site-packages/mako-1.0.0-py3.2.egg/mako/lookup.py", line 9, in <module> mako.template import template file "/var/www/finance/finance-env/lib/python3.2/site-packages/mako-1.0.0-py3.2.egg/mako/template.py", line 10, in <module> mako.lexer import lexer file "/var/www/finance/finance-env/lib/python3.2/site-packages/mako-1.0.0-py3.2.egg/mako/lexer.py", line 11, in <module> mako import parsetree, exceptions, compat file "/var/www/finance/finance-env/lib/python3.2/site-packages/mako-1.0.0-py3.2.egg/mako/parsetree.py", line 9, in <module> mako import exceptions, ast, util, filters, compat file "/var/www/finance/finance-env/lib/python3.2/site-packages/mako-1.0.0-py3.2.egg/mako/filters.py", line 38, in <module> import markupsafe file "/var/www/finance/finance-env/lib/python3.2/site-packages/markupsafe-0.23-py3.2-linux-x86_64.egg/markupsafe/__init__.py", line 70 def __new__(cls, base=u'', encoding=none, errors='strict'): ^ syntaxerror: invalid syntax

the markupsafe bundle uses syntax supported python 3.3 , up. python 3.2 not supported anymore of version 0.16.

the u'unicode' literal syntax introduced in pep 414 create easier create library code can back upwards both python 2 , 3.

either upgrade python 3.3 (or 3.4 even), or downgrade markupsafe 0.15, lastly version back upwards python 3.2.

i see mako removes markupsafe dependency when using python 3.2; if nil else depends on perhaps safe remove bundle altogether. mako.filter source code fall local implementation if bundle not installed.

python pyramid

No comments:

Post a Comment