pyborg-1up icon indicating copy to clipboard operation
pyborg-1up copied to clipboard

Bot won't read or write to .json

Open Nyatalie12 opened this issue 5 years ago • 1 comments

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.

Nyatalie12 avatar May 05 '20 17:05 Nyatalie12

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

jrabbit avatar May 06 '20 00:05 jrabbit