bundlewrap / bundlewrap

Unnecessary use of json.dumps() for file data PY-W0079
Anti-pattern
Major
6 months ago2 years old
f.write(json.dumps({'date': time(), 'user': identity()})) can be replaced with json.dump({'date': time(), 'user': identity()}, f)
 79                if self.ignore:
 80                    self.locking_node.run("mkdir -p " + quote(self._hard_lock_dir()))
 81                with open(local_path, 'w') as f:
 82                    f.write(json.dumps({ 83                        'date': time(),
 84                        'user': identity(),
 85                    }))