python-json-logger icon indicating copy to clipboard operation
python-json-logger copied to clipboard

"command" has not attribute "load"

Open Agoo1234 opened this issue 5 years ago • 1 comments

I am making a Discord bot(which, I know is unrelated to this repository) and I'm using JSON. Whenever I try to run the commands using JSON, however, I keep getting the following error: AttributeError: 'Command' object has no attribute 'load' This was working just 2 days ago, and the next morning, it suddenly stopped. Here is a snippet of my code(I am using python 3.7.3):

     gp = json.load(g)
     user = "userid_" + str(userid)
     if user not in gp:
         addprofile(userid);

Agoo1234 avatar Oct 23 '19 01:10 Agoo1234

Sounds like an issue with your code, e.g. before the snippet you post you assign a value to json (possibly in the local scope), which shadows the global module.

Because the error message plainly says that your json local variable stores an object of type Command which doesn't have a load attribute.

Assuming AwesomeAg1234/blobgivingbot is the bot in question your issue also seems completely unrelated to this project, it's not even using python-json-logger.

xmo-odoo avatar Nov 19 '19 11:11 xmo-odoo