icatproject / icat.server

The ICAT server offering both SOAP and "RESTlike" interfaces to a metadata catalog.
Other
1 stars 5 forks source link

The icatadmin script fails to run with Python 3 #305

Closed RKrahl closed 1 year ago

RKrahl commented 1 year ago

Running the icatadmin script to populate the Lucene index with Python 3 fails:

$ python3 /opt/payara5/bin/icatadmin http://icat:8080 simple username root password secret -- populate
a bytes-like object is required, not 'str'

Trying the same with Python 2 works:

$ python2 /opt/payara5/bin/icatadmin http://icat:8080 simple username root password secret -- populate
Datafile
DatafileParameter
Dataset
DatasetParameter
Investigation
InvestigationParameter
InvestigationUser
Sample

Note that the 5.0.0 release of icat.server ships icatadmin with #!/usr/bin/env python in the first line, which will cause it to be executed with Python 2 by default on most systems. So the issue may go unnoticed in production by now. But as a result of #300, this line has been changed to #!/usr/bin/env python3, so the error becomes apparent in development versions and future releases.