May-09-2020, 11:01 AM
The code line in bold is giving me the following error, please help:
Traceback (most recent call last):
File "bath_dataset_lit_link.py", line 81, in <module>
link_list.write(str(doi + '\t' + data_creators.encode("utf-8") + '\t' + lit_doi.encode("utf-8")+ '\t' + "Title: " + title.encode("utf-8") +"; Publisher: "+ pub_names.encode("utf-8") + "; Creators: "+ lit_creators.encode("utf-8") +'\n'))
TypeError: must be str, not bytes
Traceback (most recent call last):
File "bath_dataset_lit_link.py", line 81, in <module>
link_list.write(str(doi + '\t' + data_creators.encode("utf-8") + '\t' + lit_doi.encode("utf-8")+ '\t' + "Title: " + title.encode("utf-8") +"; Publisher: "+ pub_names.encode("utf-8") + "; Creators: "+ lit_creators.encode("utf-8") +'\n'))
TypeError: must be str, not bytes