[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington
miss-islington added the comment: New changeset 6935a511670797a3aaebdf96aad3dcff66baa76e by Miss Islington (bot) in branch '3.6': bpo-32984: IDLE - set __file__ for startup files (GH-5981)

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5760 ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington
miss-islington added the comment: New changeset fd340bf9e308130736c76257ff9a697edbeb082d by Miss Islington (bot) in branch '3.7': bpo-32984: IDLE - set __file__ for startup files (GH-5981)

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5754 ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5753 stage: needs patch -> patch review ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 22c82be5df70c3d51e3f89b54fe1d4fb84728c1e by Terry Jan Reedy in branch 'master': bpo-32984: IDLE - set __file__ for startup files (GH-5981) https://github.com/python/cpython/commit/22c82be5df70c3d51e3f89b54fe1d4fb84728c1e

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Cheryl Sabella
Cheryl Sabella added the comment: The change works on Linux with the patch (and gave a NameError without the patch). I left a note on the PR for a possible SyntaxError. I didn't have authority to push the blurb markup change to your branch, so I copied it into a comment.

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: With the PR, IDLE behaves the same as Python on Windows. .../3x> python -m idlelib -r f:/python/a/tem2.py (see original post for content of tem2.py) prints __file__ instead of raising NameError, while >>> __file__ continues to raise

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-04 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +5747 stage: needs patch -> patch review ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Revised, more exact, URL: https://stackoverflow.com/questions/49054093/cannot-use-file-when-running-startup-file-in-idles-normal-mode -- ___ Python tracker

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: When the IDLE GUI process is started, its main.__file__ is set to the idlelib .py file used to start the process. If IDLE is started with -n, so that user code is run in the same process (the original mode), the -r or -s startup file and

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
New submission from Terry J. Reedy : 'python somefile.py' sets main.__file__ to 'somefile.py'. 'python' leaves __file__ unset. If PYTHONSTARTUP is set to somefile.py, 'python' executes somefile.py in main with __file__ set to 'somefile.py', then unsets __file__ before the