jrabbit / pyborg-1up

:robot: A modern overhaul of an old favorite irc bot for multiple platforms
https://pyborg.readthedocs.io/en/latest/
GNU General Public License v3.0
33 stars 12 forks source link

Bot won't read or write to .json #121

Open Nyatalie12 opened 4 years ago

Nyatalie12 commented 4 years ago

I formatted a .json as a brain and the bot is neither reading nor writing to the file, even though the command line says it is.

Initially, upon startup I get

INFO:pyborg.util.util_cli:pyborg folder already exists. INFO:pyborg.pyborg:Reading dictionary... INFO:pyborg.pyborg:Updating dictionary information... Bottle v0.12.18 server starting up (using WSGIRefServer())... Listening on http://localhost:2001/

Upon shutdown I was getting this, but upon observation of the .json it was unchanged

INFO:pyborg.pyborg:Writing dictionary... INFO:pyborg.pyborg:Saving pyborg brain to C:\Users\"My_Name"\AppData\Roaming\Pyborg\brains\Jennifer.json

And now, as of writing this, I'm getting a new error on shutdown

FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\"My_Name"\AppData\Roaming\Pyborg\tmp\current.pyborg.json' -> 'C:\Users\"My_Name"\AppData\Roaming\Pyborg\brains\Jennifer.json'

If I remove Jennifer.json I get the same startup and shutdown errors even though there isn't a Jennifer.json? Wild stuff.

jrabbit commented 4 years ago

Can you include the commands you ran with the output? There's some file move code that tries to fail-safe