So we were running in to an issue yesterday where for some reason we were having maya lock up on a lot of artists while running this one tool. We traced it and after a while found out that it was locking when we were reading a json file using json.load()
I ended up just switching it to read to get the text from the file, then just run json.loads(), and it appears that fixed it, but I’m not sure why. I was thinking at first it was because the function didn’t close the file, but then I was closing it right after the load run. If you look at the code, load literally just reads the file object and runs loads with the text from the file. So in summary:
# Worked
f = open( os.path.join(pm.internalVar(upd=True), '%s_materials.json' % self.currentProject) )
txt = f.read()
f.close()
dict = json.loads(txt)
# Jammed (sometimes)
f = open( os.path.join(pm.internalVar(upd=True), '%s_materials.json' % self.currentProject) )
dict = json.load(f)
f.close()
Anyone else ever run in to load doing that? I’m glad it’s fixed, but annoyed at that I have no clue why that fixed it :sigh: