Author chortos
Recipients chortos, dmascialino, eric.araujo, eric.snow, ezio.melotti, jjconti, loewis, ncoghlan
Date 2011-11-06.04:52:01
SpamBayes Score 6.02025e-05
Marked as misclassified No
Message-id <>
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 >
import time
raise Exception
python &
sleep 1
cat <<EOF >

# This is just a comment
sleep 5
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: <>
2011-11-06 04:52:02chortoslinkissue8087 messages
2011-11-06 04:52:01chortoscreate