0

在开发环境中,它工作得很好。但是在部署到 AppEngine 之后,它就中断了。在项目中包含必要的文件。

正在使用 LEPL 5.1.3。

破损:

<type 'exceptions.SyntaxError'>: invalid syntax (parser.py, line 182)
Traceback (most recent call last):
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/controllers/main.py", line 26, in <module>
    from controllers import users as Users
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/controllers/users.py", line 15, in <module>
    from lepl.apps.rfc3696 import Email
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/lepl/__init__.py", line 113, in <module>
    from lepl.contrib.matchers import SmartSeparator2
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/lepl/contrib/matchers.py", line 41, in <module>
    from lepl.matchers.derived import Optional
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/lepl/matchers/derived.py", line 38, in <module>
    from lepl.matchers.combine import And, DepthFirst, BreadthFirst, \
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/lepl/matchers/combine.py", line 45, in <module>
    from lepl.matchers.core import Literal
  File "/base/data/home/apps/s~roo-net/4-0.361574419262849513/lepl/matchers/core.py", line 44, in <module>
    from lepl.core.parser import tagged

对 appengine 给出的这个错误消息感到非常困惑。我查看了 parser.py 中的第 182 行,它看起来不错……甚至很棒。真的很漂亮的东西。

...

          else:
                    if m_value: m_value.yield_(value)
                    yield value
                # this allows us to restart with a new evaluation
                # (backtracking) if called again.
                value = main
    except StopIteration as exception: # line 182
        if exception_being_raised:
            raise
        # otherwise, we will propagate this value
        value = exception
        exception_being_raised = True
        if m_value: m_value.exception(value)

...

4

1 回答 1

1

看起来您可能正在使用 Python > 2.5 进行开发,但正在部署到 Python 2.5。(检查runtime你的app.yaml)。for的as语法except是在 Python 2.5 之后出现的。

于 2012-09-06T22:51:34.210 回答