yaml.safe_load() throws error while reading ksy file
In some of the files, the presence of additional comments in the doc section
Attention: `rpt_callsign` cannot be accessed because `rpt_instance` is an
array of unknown size at the beginning of the parsing process! Left an
example in here.
causes yaml.safe_load() to throw an error
ScannerError: while scanning for the next token
found character '`' that cannot start any token
in "", line 50, column 12:
Attention: `rpt_callsign` cannot be accesse ...
^
Code I used when it threw the error:
with open(file, 'r') as ksy_file:
data_loaded = yaml.safe_load(ksy_file)
satellite_name = data_loaded["meta"]["id"]
# print((data_loaded['doc']))
field_load = yaml.safe_load(data_loaded["doc"][:]) # Error in this line
# print(field_load)
for fields in field_load:
# print(fields)
params.append("\t\t\tField(\'%s\', lambda x: , , \'\')"%(str(fields).split()[1]))
Files which have this comment:
- asuphoenix.ksy
- bugsat1.ksy
- csim.ksy
- entrysat.ksy
- irazu.ksy
- mysat.ksy
- origamisat1.ksy
- siriussat.ksy