ego008 / gae-bbs

一个多年前的GAE 论坛,python2.7
https://www.youbbs.org
Apache License 2.0
5 stars 3 forks source link

本地运行报错:error_handlers - file #1

Open lifeidle opened 5 years ago

lifeidle commented 5 years ago

python 2.7.15 App Engine SDK release: "1.9.80"

运行后报错: google.appengine.api.yaml_errors.EventError: Unable to assign value '' to attribute 'file': Value '' for file does not match expression '^(?:.+)$' in "C:\gaebbs\app.yaml", line 39, column 11

将: error_handlers:

修改为: error_handlers:

在sdk中成功运行,但是用浏览器打开报500错误。 The server is temporary error now. 500

Traceback (most recent call last): File "C:\gaebbs\yui.py", line 1459, in __call__ handler.get(*groups, **groupdict) File "C:\gaebbs\view.py", line 35, in get }, layout='_layout.html') File "C:\gaebbs\common.py", line 237, in echo self.write(self.render(template, context, globals, layout)) File "C:\gaebbs\common.py", line 222, in render return engine.render(template, context, globals, layout) File "C:\gaebbs\tenjin.py", line 1716, in render content = template.render(context, globals) File "C:\gaebbs\tenjin.py", line 980, in render exec(self.bytecode, globals, locals) File "templates\default\_layout.html", line 63, in <module> <?py include("sider.html") ?> File "C:\gaebbs\tenjin.py", line 1684, in include s = template.render(context, globals, _buf=_buf) File "C:\gaebbs\tenjin.py", line 980, in render exec(self.bytecode, globals, locals) File "templates\default\sider.html", line 18, in <module> </div> File "C:\gaebbs\tenjin.py", line 1678, in include template = self.get_template(template_name, context, globals) File "C:\gaebbs\tenjin.py", line 1644, in get_template if not template.bytecode: template.compile() File "C:\gaebbs\tenjin.py", line 995, in compile self.bytecode = compile(self.script, self.filename or '(tenjin)', 'exec') TypeError: expected a readable buffer object INFO 2018-11-25 18:51:26,196 module.py:861] default: "GET / HTTP/1.1" 500 974

麻烦老大看看应该怎么修改? 万谢!

ego008 commented 5 years ago

在根目录下添加一个文件 default_error.html 试试

lifeidle commented 5 years ago

添加了,还是出错,错误信息同之前一致。 拷贝了老大老版本(saespot gae版)根目录下的 default_error.html 文件到这个版本的根目录,出错。 再在 templates\default 目录中拷贝了 default_error.html 文件,出错。

`Traceback (most recent call last):

File "C:\gaebbs\yui.py", line 1459, in call

handler.get(*groups, **groupdict)

File "C:\gaebbs\view.py", line 35, in get

}, layout='_layout.html')

File "C:\gaebbs\common.py", line 237, in echo

self.write(self.render(template, context, globals, layout))

File "C:\gaebbs\common.py", line 222, in render

return engine.render(template, context, globals, layout)

File "C:\gaebbs\tenjin.py", line 1716, in render

content  = template.render(context, globals)

File "C:\gaebbs\tenjin.py", line 980, in render

exec(self.bytecode, globals, locals)

File "templates\default_layout.html", line 63, in

<?py include("sider.html") ?>

File "C:\gaebbs\tenjin.py", line 1684, in include

s = template.render(context, globals, _buf=_buf)

File "C:\gaebbs\tenjin.py", line 980, in render

exec(self.bytecode, globals, locals)

File "templates\default\sider.html", line 18, in

</div>

File "C:\gaebbs\tenjin.py", line 1678, in include

template = self.get_template(template_name, context, globals)

File "C:\gaebbs\tenjin.py", line 1644, in get_template

if not template.bytecode: template.compile()

File "C:\gaebbs\tenjin.py", line 995, in compile

self.bytecode = compile(self.script, self.filename or '(tenjin)', 'exec')

TypeError: expected a readable buffer object

INFO 2018-11-28 19:53:27,884 module.py:861] default: "GET / HTTP/1.1" 500 974 `

lifeidle commented 5 years ago

试了试传到gae运行,同样错误。 http://bbs.gaecn.com/ 老大可以看看出错页面。

ego008 commented 5 years ago

https://github.com/ego008/gae-bbs/blob/master/templates/default/sider.html#L17

报错的地方是引入的模版,模版不能为空,已经修改了

lifeidle commented 5 years ago

成功运行! 另,老大估计忘了改app.yaml了,我pull了。