You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using CVS or SVN, it is common to revert or merge a file that is open in the editor. It would be great to have a reload/refresh option on the menu to bring in the changed file. Without that option, the only approach is to close without saving, fire-up the editor again, and reload the file manually.
But isn't this an example of a bell/whistle which is outside IDLE's design policies? It would add a menu item which would be rather rarely used, especially by beginners, it seems to me. Why not just close the edit window (not IDLE) and re-open using the Files / Recent Files feature?
I agree with KBK that what you suggest goes against IDLE's philosophy, which is to be simple and uncluttered, avoiding "bells and whistles".
However, I do think that a simple "revert file" menu item in the File menu, which would just reload the file from the file system, could be generally useful.
Additionally, IDLE could monitor the file on the file system, and if it is changed outside of IDLE, ask the user whether to continue with the current version or switch to the new version on disk. I've seen some text editors do this, and it can save some headaches. Drawbacks are that some users may find this annoying (at least at first), and it could be somewhat complex to implement. Thoughts on this? Perhaps this should be brought up on IDLE-dev?
Each of the above would allow you to revert/merge using whatever CVS/SVN/etc. tools you normally use, then just load the new version inside the already open instance of IDLE. I think this would be a good separation of roles between IDLE and version control tools.
If you have more than one IDLE window open (even a shell), it's not necessary to shut down. Just close the edit window, confirm the unsaved warning, and use the Recent Files menu item to reopen with the current disk contents. We are talking about five mouse clicks instead of three, counting confirmation dialogs. In my opinion, it's not worth complicating IDLE and confusing beginners with a 'revert' menu item to save two clicks every other day or so.
I normally use IDLE with svn and never feel the need to reload something that was merged. After all, you should have updated before you opened the file in IDLE. If you modified the file in IDLE, saved, and checked it in, IDLE's copy is the same as svn.
Maybe you have a use case I haven't considered. If it's a good one, then a (normally inactive) IDLE extension might be warranted for those who really need this.
Adding a warning when saving that the file has changed on disk is a good emacs feature which has saved my bacon a number of times. That would be a good feature to add to IDLE, but that's a different request. Rejecting this one.
Nashev commented on Jan 11, 2008
Nashevmannequin
Mannequin
More actions
It is very nice feature, that exists in many advanced and professional
GUI-based editors on the Windows and Mac. For example, i can fast name
TextWrangler, HomeSite, Flash, PhotoShop and it is only first names in
mind. It feature for simplify tool's usage, it is improve GUI usability.
Nashev commented on Jan 11, 2008
Nashevmannequin
Mannequin
More actions
There are command in menu is called "Revert".
P.S.: for knowing that file changed, programs in windows can register OS
callback for this event and just react on it. In Mac i think too, but i
don't know how with it on unix and python.
I have done a very initial patch in an attempt to define where we should
go with this feature. There are several different proposals around this
issue and the superseded one, I opted to implement the simplest one
which is to add a 'Revert' entry in the file menu which re-reads the
file currently open.
There are at least two problems with this patch. First, I don't think
there is a non-hacky way to place a command on a menu in a specific
place by using an idle extension, so, the 'Revert' entry is the last
entry in the file menu right now. I guess this would be solved by not
making this an extension and then proceed to manually remove the menu
entry while creating the shell window (similarly to what it is done when
running under mac osx). The second problem happens when reverting the
file, I'm not sure if it should be done differently but this seems to
cause some problem with Multicall.
gpolo commented on Aug 13, 2009
gpolomannequin
Mannequin
More actions
Kurt, there is now a patch on bpo-6699 which adds your suggested feature:
"Adding a warning when saving that the file has changed on disk is a
good emacs feature which has saved my bacon a number of times. That
would be a good feature to add to IDLE, but that's a different request".
Activity
rhettinger commentedon May 18, 2007
When using CVS or SVN, it is common to revert or merge a file that is open in the editor. It would be great to have a reload/refresh option on the menu to bring in the changed file. Without that option, the only approach is to close without saving, fire-up the editor again, and reload the file manually.
kbkaiser commentedon May 22, 2007
But isn't this an example of a bell/whistle which is outside IDLE's design policies? It would add a menu item which would be rather rarely used, especially by beginners, it seems to me. Why not just close the edit window (not IDLE) and re-open using the Files / Recent Files feature?
taleinat commentedon Jul 20, 2007
I agree with KBK that what you suggest goes against IDLE's philosophy, which is to be simple and uncluttered, avoiding "bells and whistles".
However, I do think that a simple "revert file" menu item in the File menu, which would just reload the file from the file system, could be generally useful.
Additionally, IDLE could monitor the file on the file system, and if it is changed outside of IDLE, ask the user whether to continue with the current version or switch to the new version on disk. I've seen some text editors do this, and it can save some headaches. Drawbacks are that some users may find this annoying (at least at first), and it could be somewhat complex to implement. Thoughts on this? Perhaps this should be brought up on IDLE-dev?
Each of the above would allow you to revert/merge using whatever CVS/SVN/etc. tools you normally use, then just load the new version inside the already open instance of IDLE. I think this would be a good separation of roles between IDLE and version control tools.
kbkaiser commentedon Jul 22, 2007
If you have more than one IDLE window open (even a shell), it's not necessary to shut down. Just close the edit window, confirm the unsaved warning, and use the Recent Files menu item to reopen with the current disk contents. We are talking about five mouse clicks instead of three, counting confirmation dialogs. In my opinion, it's not worth complicating IDLE and confusing beginners with a 'revert' menu item to save two clicks every other day or so.
I normally use IDLE with svn and never feel the need to reload something that was merged. After all, you should have updated before you opened the file in IDLE. If you modified the file in IDLE, saved, and checked it in, IDLE's copy is the same as svn.
Maybe you have a use case I haven't considered. If it's a good one, then a (normally inactive) IDLE extension might be warranted for those who really need this.
Adding a warning when saving that the file has changed on disk is a good emacs feature which has saved my bacon a number of times. That would be a good feature to add to IDLE, but that's a different request. Rejecting this one.
Nashev commentedon Jan 11, 2008
It is very nice feature, that exists in many advanced and professional
GUI-based editors on the Windows and Mac. For example, i can fast name
TextWrangler, HomeSite, Flash, PhotoShop and it is only first names in
mind. It feature for simplify tool's usage, it is improve GUI usability.
Nashev commentedon Jan 11, 2008
There are command in menu is called "Revert".
P.S.: for knowing that file changed, programs in windows can register OS
callback for this event and just react on it. In Mac i think too, but i
don't know how with it on unix and python.
terryjreedy commentedon Aug 8, 2008
This appears to me to duplicate and supercede
http://bugs.python.org/issue1175686
If so, could that be closed as superceded?
gpolo commentedon Aug 3, 2009
I have done a very initial patch in an attempt to define where we should
go with this feature. There are several different proposals around this
issue and the superseded one, I opted to implement the simplest one
which is to add a 'Revert' entry in the file menu which re-reads the
file currently open.
There are at least two problems with this patch. First, I don't think
there is a non-hacky way to place a command on a menu in a specific
place by using an idle extension, so, the 'Revert' entry is the last
entry in the file menu right now. I guess this would be solved by not
making this an extension and then proceed to manually remove the menu
entry while creating the shell window (similarly to what it is done when
running under mac osx). The second problem happens when reverting the
file, I'm not sure if it should be done differently but this seems to
cause some problem with Multicall.
gpolo commentedon Aug 13, 2009
Kurt, there is now a patch on bpo-6699 which adds your suggested feature:
"Adding a warning when saving that the file has changed on disk is a
good emacs feature which has saved my bacon a number of times. That
would be a good feature to add to IDLE, but that's a different request".
20 remaining items
terryjreedy commentedon Jul 28, 2020
Recent edits to iomenu.IOBinding.loadfile were intended to preserve the option of reloading a non-empty editor.
CoolCat467 commentedon Aug 16, 2024
I've made an IDLE extension that implements the ability to reload the file: https://pypi.org/project/idlereload/
ashm-dev commentedon Nov 13, 2025
Ping. Is this issue still relevant?
CoolCat467 commentedon Nov 13, 2025
Still not a built-in feature, so I would argue yes.
terryjreedy commentedon Nov 14, 2025
Leave it open
pythongh-44968: Add "Reload from Disk" feature to IDLE
pythongh-44968: Add "Reload from Disk" feature to IDLE
[-]Add File - Reload[/-][+]IDLE: Add File - Reload[/+]