Raise lifecycle events properly when creating files
pyflakes clenaup