fkie_node_manager_daemon: fixed read version with python 3
@@ -61,23 +61,23 @@ def detect_version(package):
try:
with open("%s/VERSION" % pkg_path) as f:
version = f.read()
- version = version.strip()
+ version = version.strip().decode('utf-8')
with open("%s/DATE" % pkg_path) as f:
datetag = f.read().split()
if datetag:
- date = datetag[0]
+ date = datetag[0].decode('utf-8')
except Exception as err:
sys.stderr.write("version detection error: %s" % utf8(err))
elif os.path.isdir("%s/../.git" % pkg_path):
try:
os.chdir(pkg_path)
ps = SupervisedPopen(['git', 'describe', '--tags', '--dirty', '--always', '--abbrev=8'], stdout=subprocess.PIPE, object_id='get git version')
- output = ps.stdout.read()
+ output = ps.stdout.read().decode('utf-8')
version = output.strip()
ps = SupervisedPopen(['git', 'show', '-s', '--format=%ci'], stdout=subprocess.PIPE, object_id='get git date')
output = ps.stdout.read().split()
if output:
- date = output[0]
+ date = output[0].decode('utf-8')
except Exception as err:
sys.stderr.write("version detection error: %s" % utf8(err))
else:
