Skip to content

Instantly share code, notes, and snippets.

View ecpost's full-sized avatar

Ethan Post ecpost

  • Huntington Beach, CA, USA
View GitHub Profile
@ecpost
ecpost / rename_bug_demo.py
Created February 5, 2016 19:21
Demo of Permission denied exception when reading from file while another thread uses werkzeug.posixemulation.rename to replace it.
from werkzeug.posixemulation import rename
from threading import Thread
from time import sleep
filename = 'test_file.dat'
running = True
def create_file():
new_file = 'test_file.tmp'
with open(new_file, 'w') as f: