Python crash with Bus Error when calling form object with ()

8 views
Skip to first unread message

andrei

unread,
Oct 27, 2008, 10:34:36 AM10/27/08
to web.py
Mac OS X with both original python 2.5.1 and macports python 2.5.2 i
get Bus Error and Python crashes.

when i call form object with ()

login_form = form.Form(
form.Textbox("login", description = "Login:"),
form.Password("password", description = "Password:")
)

return render.login(login_form()) # gives me bus errror
return render.login(login_form) # gives no errors

same if i pass web.input() to form as argument


I checked form.py and noticed it uses deepcopy for this, please help
me. what might be wrong?

andrei

unread,
Oct 27, 2008, 10:59:42 AM10/27/08
to web.py
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

andrei

unread,
Oct 27, 2008, 11:05:27 AM10/27/08
to web.py
oh, and this code works as desired - outputs form with filled in
values:

import web
render = web.template.render('templates/')
login_form = web.form.Form( web.form.Textbox("login"),
web.form.Password("password"))
print render.login(login_form({'login':'admin','password':'admin'}))

so it might be an web.auto_application() issue ?

andrei

unread,
Oct 27, 2008, 11:14:43 AM10/27/08
to web.py
I use intel mac os x on imac 20'', and this is crash report:
http://old.etoleto.com/error.txt
I've even tried to reinstall mac os x completely, but still get this
error.

Any help is appreciated.
Reply all
Reply to author
Forward
0 new messages