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.

classification
Title: IDLE ignores module change before restart
Type: behavior Stage:
Components: IDLE Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: kbk Nosy List: gpolo, kbk, markveldhuis, terry.reedy
Priority: normal Keywords:

Created on 2008-05-04 13:55 by markveldhuis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
idleupdatebug.txt markveldhuis, 2008-05-11 16:49
Messages (12)
msg66210 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-04 13:55
I changed module A, and then tested module B that imported module A. it
took a while to realise that what went wrong was that the change had not
registered in module B, even when I closed and reopened the window, the
shell etc. I had to quit IDLE and restart before module B imported the
changed module A. In the file enclosed is a step by step version that
isolates the problem.
At the moment I am working through a Python course using IDLE on UBUNTU
Hardy, and it could be this is a beginners error and no bug after all.
msg66507 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2008-05-10 02:18
On Windows, I tested this in both 2.5.2 and 3.0a4.
In both cases, at paragraph 4 of your report, I got 2 in the shell, as
you expected,not 1.  I have no idea whether the system difference makes
a difference (the TCL and TK binaries are obviously different also), or
you did not do what you think you did, or you encountered some random
glitch.  Perhaps you can try again?

If no one can reproduce, we will have to close, but I will wait for now.
msg66589 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-10 22:04
When you "open" a python file, exactly what steps are you taking?

When you "close any combination of IDLE windows,( but not all)",
are you leaving update.py open so you can "run" it?

When you "run" a file, exactly what steps are you taking?

When you add files to the tracker, please use plain text files so
they can be opened in a browser, without firing up Office!
msg66644 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-11 16:49
Hi,

I repeated the same steps as before, with new filenames, and with the
same result, the printed value was 1, and not 2 as expected. After
closing all windows the value was 2.

answers to Kurt's questions:

When you "open" a python file, exactly what steps are you taking?
->I use File - Recent file - <filename> from the menu

When you "close any combination of IDLE windows,( but not all)",
are you leaving update.py open so you can "run" it?
->No, it occurs even when I close update.py and reopen it using the
method above

When you "run" a file, exactly what steps are you taking?
->I press F5 when the update.py window is active

When you add files to the tracker, please use plain text files so
they can be opened in a browser, without firing up Office!
->thanks for the tip!
msg66782 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-13 14:06
Thanks.  Another question: when the shell starts, do you
see the text

  ==== No Subprocess ====

to the right of the IDLE version, e.g.

IDLE 2.6a3      ==== No Subprocess ====
msg66804 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-13 21:32
thank you too. Yes the text is there, I pasted the whole header here:


Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 1.2.2      ==== No Subprocess ====
>>>
msg66868 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-15 15:14
Sorry for the delay.

OK, we are getting closer.  Please tell me exactly how you start IDLE.
msg66876 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-15 18:48
Interesting. I click on an icon-launcher in my panel. The command in the
launcher's properties is: "/usr/bin/idle-python2.5 -n". I got the icon
by dragging the regular icon from under applications-programming-Idle to
the panel.
msg66934 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-16 12:00
I think this solves my problem, I took away the -n from the launcher so
the command is just "/usr/bin/idle-python2.5". Now Idle does not show
the No subprocesses text, and when I press F5 the Python shell displays
a line with ====Restart====. I tested my case and the value change in
the imported module was recognised as expected. The launcher under
applications still gives the no subprocesses version.
But for other Ubuntu users the problem may persist, where does the
"/usr/bin/idle-python2.5 -n" come from?
I installed idle using System-Administration-Synaptic package manager,
where I selected Idle-python2.5 I don't know enough about it to say
whether the command comes from there or is interpreted somehow during
the installation, or some other way.
Thank you for your help so far, it makes my Python learning so much easier
msg66936 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-16 12:56
Yes, removing the -n is the way to fix your problem.  We went to quite 
a bit of effort to run user code from scratch on each Run/F5 using the 
subprocess.  Running without the subprocess is considered 'expert' mode 
these days. (Although it's still used on Windows if the user edits a 
file via the right click menu - something we hope to fix.)

There is a way around your difficulty - it involves using 'reload', but 
I didn't want to tell you about that too soon :-)

Now I need to look at Debian/Ubuntu to find out why the switch was 
added.  I run Debian, but not Ubuntu, and I use the command line 
pretty 
exclusively, so it didn't bite me.  If this is the way the IDLE package 
is configured, I'm surprised the issue hasn't been reported 
previously.  Thanks for the report!
msg67069 - (view) Author: Mark Veldhuis (markveldhuis) Date: 2008-05-19 18:14
Sure, and thank you for your efforts. It will be interesting to see if
it really is the package. If there is anything I can do to test, just
drop a note.
msg84443 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-03-29 23:13
Is there any reason to keep this open ? It is not a IDLE bug, the title
is misleading, and a solution has been provided for the problem related
to how Ubuntu packages IDLE.
History
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 47004
2009-03-30 06:37:53terry.reedysetstatus: open -> closed
resolution: not a bug
2009-03-29 23:13:30gpolosetnosy: + gpolo
messages: + msg84443
2008-05-19 18:14:54markveldhuissetmessages: + msg67069
2008-05-16 12:56:27kbksetassignee: kbk
messages: + msg66936
2008-05-16 12:00:44markveldhuissetmessages: + msg66934
2008-05-15 18:48:23markveldhuissetmessages: + msg66876
2008-05-15 15:14:14kbksetmessages: + msg66868
2008-05-13 21:32:07markveldhuissetmessages: + msg66804
2008-05-13 14:07:32kbksetmessages: + msg66782
2008-05-11 16:49:31markveldhuissetfiles: - idleupdatebug.odt
2008-05-11 16:49:24markveldhuissetfiles: + idleupdatebug.txt
messages: + msg66644
2008-05-10 22:04:17kbksetnosy: + kbk
messages: + msg66589
2008-05-10 02:18:22terry.reedysetnosy: + terry.reedy
messages: + msg66507
2008-05-04 13:58:23markveldhuissetfiles: + idleupdatebug.odt
2008-05-04 13:57:26markveldhuissetfiles: - idleupdatebug.odt
2008-05-04 13:55:19markveldhuiscreate