I've been trying to find information about accessi...
# pex
a
I've been trying to find information about accessing non-py files from within a built pex, and haven't been able to find much. So my app has translation files, as well as some template files to be used with Jinja, and if I build with pants the absolute path (e.g.
os.path.join(os.path.abspath(os.path.dirname(__file__)), TEMPLATE_DIR)))
) the path always starts with the
.pex
file as if it were a directory. Resulting in something like:
/app/server.pex/data/something
, but
server.pex
is not a directory and any
open()
call to a file with this directory prefix will cause an IOError.