HDFGroup / hdf5-json

Specification and tools for representing HDF5 in JSON
https://hdf5-json.readthedocs.io
Other
72 stars 25 forks source link

security bug in pip version? #61

Closed dave31415 closed 6 years ago

dave31415 commented 6 years ago

I installed from pip Typing the command h5tojson.py outputs/autoencoder_model.h5

gives me a bunch of error messages including

from: can't read /var/mail/h5json

Why is it trying to read from my mail folder?

The package build from scratch doesn't have this problem. Please update pip.

jreadey commented 6 years ago

I suspect that the command was being interpreted as a bash script rather than python.

What happens if you run: python /usr/local/bin/h5tojson.py output/autoenconder_model.h5 ?

The setup script needs some improvement - it should be "h5tojson" that is put into the path as an app by the installer.

dave31415 commented 6 years ago

Yeah. The file is indeed a long python script but with no #!/bin/python on top. Calling this, as you suggest, works fine. python /usr/local/bin/h5tojson.py output/autoenconder_model.h5

The one I build from git is a short python script and it works

#!/usr/local/bin/python
# EASY-INSTALL-SCRIPT: 'h5json==1.1.1','h5tojson.py'
__requires__ = 'h5json==1.1.1'
__import__('pkg_resources').run_script('h5json==1.1.1', 'h5tojson.py')
jreadey commented 6 years ago

I've updated setup so that install puts "h5tojson" and "jsontoh5" in the path.