diff --git a/normalizer/normalizer-repo-tags/calculate_repo_tags.py b/normalizer/normalizer-repo-tags/calculate_repo_tags.py index ccc8fa3e7934e3f895a8d4b11bf6484aa8e71128..5f501667fbdff0d4f2d160b0b2a8bfea27b60f00 100644 --- a/normalizer/normalizer-repo-tags/calculate_repo_tags.py +++ b/normalizer/normalizer-repo-tags/calculate_repo_tags.py @@ -16,8 +16,9 @@ def calculateTags(inputDict, backend, calcUri): backend.openContext(calcUri) repoSect = backend.openSection("section_repository_info") repo_dic_sub = subprocess.Popen(['/u/jungho/myscratch/NomadRepositoryParser/bin/python', 'extract_from_repo.py'], stdin = subprocess.PIPE, stdout = subprocess.PIPE) - repo_dic_sub_out = repo_dic_sub.communicate(json.dumps(inputDict)+'\n')[0] - repo_dic = json.loads(repo_dic_sub_out) + inputDict_str = json.dumps(inputDict)+'\n' + repo_dic_sub_out = repo_dic_sub.communicate(inputDict_str.encode('utf-8'))[0] + repo_dic = json.loads(repo_dic_sub_out.decode("utf-8")) #backend.addValue("repository_checksum", repo_dic['checksum']) backend.addValue("repository_chemical_formula", repo_dic['formula']) @@ -54,8 +55,8 @@ def main(): calcUri, parserInfo = {'name':'RepoTagsNormalizer', 'version': '1.0'}) - dictReader=ParseStreamedDicts(sys.stdin) - #dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt", 'r')) + #dictReader=ParseStreamedDicts(sys.stdin) + dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt", 'r')) while True: inputDict=dictReader.readNextDict()