Hey guys,

I'm probably doing something wrong, so I thought I'd ask here to see if 
anybody has any ideas; basically, I'm trying to pass in some datetime 
objects into a template, and have the template compute some timedeltas from 
them and format them nicely. To that end, in my code file I added:

modules = {'datetime': datetime, 'time' : time}
render = web.template.render('templates/', globals=modules)

And I try to use time from the template:

$time.strptime(log['end_time'], "%Y-%m-%d %H:%M:%S")

However, it fails at runtime with the error:

RuntimeError: cannot unmarshal code objects in restricted execution mode

I did some Google'ing and it turns out this is an error thrown out by 
Restricted Python, which (according to this 
thread: https://groups.google.com/forum/#!topic/webpy/oC4L2tCkSJs) is not 
used by web.py. Does anyone know what is going on, and if this is doable? 
I'm totally willing to find a way to just turn off any execution 
restrictions, I'm not at all concerned about safety here (this won't be 
running externally).

Thanks!
-Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to