Wednesday, March 7, 2018

json - Python won't handle simple exception

It just wont go into the except block, instead it states there is not such file or directory.. shouldn't it enter in the except block if I get an IOError? what am I missing?




try:
file_users = open ('datos/usuarios.json','r')
dic = json.load(file_users)
file_users.close()
except EOFError, IOError:
print("File does not exist")

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...