Eryk Sun <eryk...@gmail.com> added the comment:
> if sys.stdout is None and no file in sys.argv With the app distribution from the Microsoft Store, "idle3.x.exe" is a GUI executable that runs idlelib. There isn't a console version. Also, GUI scripts are usually run with the pyw.exe launcher or pythonw.exe, e.g. `pyw -m idlelib`, to ensure it's not attached to a console session. Otherwise the shell waits for a console app such as py.exe, which blocks the console. Moreover, when a console session is closed, all processes attached to it have 5 seconds to exit before they get terminated. I generally don't want either behavior with a GUI app, except for the case of debugging an application that writes debug output to standard error or standard output. On the other hand, I generally do want to inherit the working directory of the parent process, such as a command-line shell. I think the problem would be adequately addressed by blacklisting directories that are known to be inappropriate and a common problem, such as sys.prefix and Windows system directories. I agree with the suggestion to automatically change the working directory in such cases to the user's "Documents" directory, i.e. FOLDERID_Documents. ---------- versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue22121> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com