I've modified a .py file on a production server and the changes are not being applied. At first I thought this was because the associated .pyc file was not being updated. So I deleted the .pyc file and tested hoping the .py file would compile into a new .pyc file. The applications behavior did not update and a new .pyc file was not created. This was done based off a previous question.
How is it that the script is executing without generating a new .pyc file? Here are the two files in question:
-rw-r--r-- 1 ubuntu ubuntu 47872 Jul 13 04:39 admin_email.py
-rw-r--r-- 1 root root 48212 Feb 10 03:12 admin_email.pyc
admin_email.pyc has been deleted. Only admin_email.py remains on there server.
Here is the code that is executing the script that has been changed:
from xxx.admin_email import send_email_admins
...
g = lambda x, y, z: send_email_admins(x, y, z)
...
threading.Thread(target=g, args=(order_id, request.user.email, form.cleaned_data)).start()
The application is being served with gunicorn + nginx.
Any ideas on what the issue is? Why is a new .pyc file being created? More importantly why is the applications behavior not being updated?