On Tue, Nov 19, 2024 at 4:21 PM Thomas Passin wrote: > > I have tracked down what is happening but I don't know why. The problem > is not with the restart command, it's with the runLeo.py module. It runs a > different version of Leo, and even a different version of Python, depending > on how it is invoked even though you would swear the results should be the > same. Details are in the issue I just filed: > > https://github.com/leo-editor/leo-editor/issues/4199 > > > The reason that this problem has been showing up with the restart-leo > command is that the launch command that is captured by sys.argv is NOT > always that same command that launched Leo in the first place. The case > that occurs for me is that I launch Leo using > > py -m leo.core.runLeo >
Bingo! My *local* leo.cmd is: python C:\Repos\leo-editor\launchLeo.py %* This tells python *exactly* where to find Leo's repo. In contrast, py -m leo.core.runLeo does not. Unless I am mistaken, this difference explains: - All the behaviour you describe. - The reason I have never seen the behaviors you describe. *Discussion* Using python -m is often correct, so *the choice will always be a tripper*. I use this *local* file, *run-installed-leo.cmd*, during testing, as discussed in the distribution checklist: rem Do **NOT** run this script from the leo-editor folder. rem pip must *not* find the leo-editor folder! cd c:\Repos call python -m leo-editor.leo.scripts.run_installed_leo cd c:\Repos\leo-editor In this script, *python -m* is correct. *A similar tripper?* I am having a devil of a time with #4179 <https://github.com/leo-editor/leo-editor/issues/4179>: use a dark theme for Leo's website. Single-stepping through the `*@button make-sphinx*` script in LeoDocs.leo showed mismatches between python.exe and the sphinx libs! I'm still investigating. I did notice an unexpected venv folder in my python folder. I foolishly ignored that surprise at the time, but I'll get back to *that* mystery soon enough. *Summary* *py -m* may have unexpected consequences that will bite devs especially. HTH. Please let me know whether this post solves the mystery for you. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3Xfk7EPsnGCWwiSvgu0AUK5j_2X6dkLaM8%3D%2B-_z0s%2B4g%40mail.gmail.com.
