Use the `with` statement instead.
```Python
with open(project_filename, 'wb') as file_object:
  json.dump(project_config, file_object)
```