I'm noticed a strange Import error in some web.py template. I nailed
down the problem to the following python code.

__builtins__ = {}

import datetime
now = datetime.datetime.utcnow()
print now.strftime("%m %Y")

It fails with the following error.

Traceback (most recent call last):
  File "foo.py", line 6, in <module>
    print now.strftime("%m %Y")
KeyError: '__import__'

Any experts around for explaining this behavior?
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to