this is the code that crashes:
code.py:
import web
app = web.auto_application()
render = web.template.render('templates/')
login_form = web.form.Form( web.form.Textbox("login"),
web.form.Password("password"))
class login(
app.page):
def GET(self):
return render.login(login_form())
if __name__ == "__main__":
app.run()
templates/login.html:
$def with (login_form)
<form method="post" enctype="multipart/form-data" action="">
$:login_form.render()
<p><input type="submit" value="Enter" /></p>
</form>
1. if i change "return render.login(login_form())" to "return
render.login(login_form)" - then i get no errors
2. if i change it to "return
render.login(login_form({'login':'admin','password':'admin'}))" -
Python app crashes with Bus Error
3. if i change it to
login_form.validates({'login':'admin','password':'admin'})
return render.login(login_form)
then i get no errors