[issue41434] IDLE: Option to warn user on "Run Module" if file is not Python source

2020-10-23 Thread Mark Roseman
Mark Roseman added the comment: I like Terry's idea of providing a better error message than just "invalid syntax" when we run something that likely isn't a Python file. There doesn't seem to be any great danger in trying to run any file that would justify a warning beforehand. --

[issue41434] IDLE: Option to warn user on "Run Module" if file is not Python source

2020-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I disagree. IDLE already shows a note -- in the editor window -- with the first noted divergence from python code marked. We are trying to keep IDLE relatively simple and not clutter it with trivial options. ispythonsource is just a guess. The decision

[issue41434] IDLE: Option to warn user on "Run Module" if file is not Python source

2020-07-29 Thread E. Paine
E. Paine added the comment: I think this sounds like a very good idea. I would recommend using the `ispythonsource` method (in the editor class) as it already has all the logic you need while also checking for a start line like "#!/usr/bin/env python" (rather than relying solely on the