A fork of tumblr-utils with Python 3 support, bug fixes, and lots of features I found useful.

Create file if it doesn't exist and truncate existing content#20

Closed
Opened 2/21/20241 commentsby facebook-reality
facebook-reality

Addresses a couple of issues I found setting an API key: 1. `r+` doesn't create the file if it's not found. Bug can be reproduced by deleting `~/.config/tumblr-backup` 2. `json.load(f)` will fail raise an exception it reads an empty file, so we can give it a simple `{}` and then raise a more specific error if the user messes up their config 3. Truncates files before writing. Old contents of the file will remain if the new content is shorter. Idk if OAuth keys are of a fixed length, but doesn't hurt to keep around

AI Analysis

This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by facebook-reality and has received 1 comments.

Add a comment
Comment form would go here