Use yaml.safe_dump() instead of yaml.dump()

Remove Python specific types from YAML output
Produce only basic YAML tags

Change-Id: Ib6a4c18663897efb7243ed1ff84df1c9f2abf8bf
This commit is contained in:
zhuzeyu 2017-03-30 16:54:00 +08:00
parent 04ebda9e44
commit a1e2901c30
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ def main():
])
with open(passwords_file, 'w') as f:
f.write(yaml.dump(passwords, default_flow_style=False))
f.write(yaml.safe_dump(passwords, default_flow_style=False))
if __name__ == '__main__':
main()

View File

@ -32,7 +32,7 @@ def main():
new_passwords.update(old_passwords)
with open(args.final, "w") as destination:
yaml.dump(new_passwords, destination, default_flow_style=False)
yaml.safe_dump(new_passwords, destination, default_flow_style=False)
if __name__ == '__main__':