So I am getting this error here:
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not TextIOWrapper
This error happens when I run this code:
def changeusername():
print("Change Your Username:")
username = str(input(">>> "))
with open('settings/userInfo.json', 'w') as f:
tempholder = json.loads(f)
tempholder['Username'] *= username
f.seek(0)
f.write(json.dumps(tempholder))
print("Changed Name.")
Essentially I have this JSON file that has a "username" string element in it. I want to change the string element to my input and then save it for later use. The file location is correct and all the code works without the actual JSON function. I have also imported the JSON module. Anyhow, thanks for your help!