Guest User

Untitled

a guest
Feb 25th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. with open('file2.json', 'r', encoding="utf8") as file_data:
  2. datas = json.load(file_data)
  3.  
  4. PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'file2.json'
  5.  
  6. filename = 'file2.json'
  7. if os.path.exists(filename):
  8. os.remove(filename)
  9.  
  10. os.chmod(filename, 0o777)
  11.  
  12. fn = open(filename, 'r')
  13. fn.close()
Add Comment
Please, Sign In to add comment