fix for opening files in py3 (#420)
fix for opening files in py3 (#420)

* fix for opening files in py3

fixes also https://github.com/web2py/web2py/issues/1451

* fix for PY2 detection

willimoa/pydal,web2py/pydal