nla / jvmctl

Java app deployment tool
MIT License
1 stars 1 forks source link

string decoding fix for rhel8 #24

Closed sdarvell closed 4 years ago

sdarvell commented 4 years ago

jvmctl list fails in rhel8 and python 3 with

NODE VERSION PORT STATUS Traceback (most recent call last): File "/usr/bin/jvmctl", line 11, in load_entry_point('jvmctl==0.5.2', 'console_scripts', 'jvmctl')() File "/usr/lib/python3.6/site-packages/jvmctl/jvmctl.py", line 1055, in main list_nodes() File "/usr/lib/python3.6/site-packages/jvmctl/jvmctl.py", line 1027, in list_nodes pid = node.pid() File "/usr/lib/python3.6/site-packages/jvmctl/jvmctl.py", line 506, in pid return int(out.split('=')[1].strip()) TypeError: a bytes-like object is required, not 'str'

while it struggles to interpret the binary response from process.communicate(). This forces the encoding of the stdout object to utf8 so that it can be interpreted by the split method. Tested against python2 and it appears to respond as it should

ato commented 4 years ago

Ah. Nice work.