This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chortos
Recipients chortos, dmascialino, eric.araujo, eric.snow, ezio.melotti, jjconti, loewis, ncoghlan
Date 2011-11-06.04:52:01
SpamBayes Score 6.0202503e-05
Marked as misclassified No
Message-id <1320555122.7.0.0525484138286.issue8087@psf.upfronthosting.co.za>
In-reply-to
Content
I just want to note that the code might be edited not only while it is running it in the interactive interpreter but also while it is running as a standalone script. In this case the script naturally would not know to reload its own code nor allow the user to do it manually, and even if it would, some objects created from the old code would probably remain alive.

Here is a simple shell script that causes Python to show a stack traceback with '# This is just a comment' as the offending line by launching it in the background and then overwriting the Python code. What happened in reality is that I launched a front-end tool for video transcoding I had written in Python and after a while tweaked the code while it was still running. When the actual encode finished, my (buggy) clean-up code raised an exception and I got a traceback saying it had been raised in a line that only had a comment in it.

cat <<EOF >proof.py
import time
time.sleep(5)
raise Exception
EOF
python proof.py &
sleep 1
cat <<EOF >proof.py


# This is just a comment
EOF
sleep 5
History
Date User Action Args
2011-11-06 04:52:02chortossetrecipients: + chortos, loewis, ncoghlan, jjconti, ezio.melotti, eric.araujo, dmascialino, eric.snow
2011-11-06 04:52:02chortossetmessageid: <1320555122.7.0.0525484138286.issue8087@psf.upfronthosting.co.za>
2011-11-06 04:52:02chortoslinkissue8087 messages
2011-11-06 04:52:01chortoscreate