X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=lib%2Fmudpy%2Fdata.py;fp=lib%2Fmudpy%2Fdata.py;h=8386842c4d3ace3b97b9e6e54e662184b52902cb;hp=062bd8713c7af1b75f3935d5cfeafd5e5415e203;hb=7e78772b5ba2efbb84710db0ecd540c9b745217a;hpb=19558d35ce08fb9df044b3c9569eb66e7b3e6f9e diff --git a/lib/mudpy/data.py b/lib/mudpy/data.py index 062bd87..8386842 100644 --- a/lib/mudpy/data.py +++ b/lib/mudpy/data.py @@ -26,7 +26,7 @@ class DataFile: """Read a file and create elements accordingly.""" self.modified = False try: - self.data = yaml.load(open(self.filename)) + self.data = yaml.safe_load(open(self.filename)) except FileNotFoundError: # it's normal if the file is one which doesn't exist yet log_entry = ("File %s is unavailable." % self.filename, 6) @@ -162,8 +162,8 @@ class DataFile: os.umask(old_umask) # write and close the file - yaml.dump(self.data, allow_unicode=True, default_flow_style=False, - stream=file_descriptor) + yaml.safe_dump(self.data, allow_unicode=True, + default_flow_style=False, stream=file_descriptor) file_descriptor.close() # unset the modified flag