def dump_marshal(data, path_to_file): try: with open(path_to_file, 'w') as f: m.dump(data, f) except Exception as e: raise e