[issue17838] Can't assign a different value for sys.stdin in IDLE

2021-09-27 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-06-11 Thread Roger Serwy
Roger Serwy added the comment: I'm closing this issue as the original problem reported has been resolved. -- stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-13 Thread Georg Brandl
Georg Brandl added the comment: Sorry, this was not clear to me. 3.2 users will have to live with the bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5f62c848f713 by Benjamin Peterson in branch '3.3': prevent IDLE from trying to close when sys.stdin is reassigned (#17838) http://hg.python.org/cpython/rev/5f62c848f713 New changeset bc322854c336 by Georg Brandl in branch 'default': Issue #17838:

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.2? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-12 Thread Georg Brandl
Georg Brandl added the comment: Not necessary as per msg188301. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___ ___ Python-bugs-list

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I mean applying both issue17585 and issue17838 patches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-12 Thread Roger Serwy
Roger Serwy added the comment: Georg, I need to clarify what I meant in msg188301. Issue9290 was applied to 3.2 which introduced the bug addressed in issue17585, whose fix then introduced issue17838. IDLE on the 3.2 branch doesn't handle exit() or quit() correctly. It needs both #17585 and

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4b3d18117813 by Benjamin Peterson in branch '2.7': prevent IDLE from trying to close when sys.stdin is reassigned (#17838) http://hg.python.org/cpython/rev/4b3d18117813 -- nosy: +python-dev ___ Python

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-11 Thread Benjamin Peterson
Benjamin Peterson added the comment: I applied the least controversial patch, which fixes the regression, so 2.7.5 can be released. Feel free to tweak as needed. -- priority: release blocker - normal ___ Python tracker rep...@bugs.python.org

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-03 Thread Roger Serwy
Roger Serwy added the comment: 3.2 still has the problem fixed in issue17585 for 3.3 and 3.4. This only applies if issue17585 patch gets applied to 3.2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-02 Thread Roger Serwy
Roger Serwy added the comment: Keeping the sys.stdin reference alive and then reassigning sys.stdin prevents exit() and quit() from actually closing IDLE since site.py's code closes sys.stdin which then does not trigger PyShell's close() method. I updated Terry's patch to explicitly call the

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-02 Thread Georg Brandl
Georg Brandl added the comment: Is this applicable to 3.2? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___ ___ Python-bugs-list mailing

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Due to the coming of regression fix releases the fix for this issue urgently needed. It fixes a regression in issue17585 which fixes a regression in last bugfix releases. -- nosy: +benjamin.peterson, georg.brandl, larry priority: normal - release

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-28 Thread Roger Serwy
Roger Serwy added the comment: I agree with Serhiy that the patch should be updated to better explain why the extra reference to stdin was being held. The attached patch provides that update in case anyone considers applying it in the future. Terry, are you suggesting that the code should

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Last patch LGTM. With keeping a reference in sys.__stdin__ we will encounter same issue. sys.stdin = None sys.__stdin__ = None # close! -- ___ Python tracker rep...@bugs.python.org

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Roger: yes. This solves immediate problem and makes Idle more like console interpreter. Same should be done for all three. Serhiy: the sole and documented purpose of sys.__stdxyz__ is to serve as backup bindings for the three i/o streams, so rebinding them is

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Roger Serwy
Roger Serwy added the comment: If we remove .close() then we'll need to then have an alternative way to allow exit() and quit() to actually close IDLE. The RPC proxy already transfers exceptions between the subprocess and the front-end, so we could catch the SystemExit exception and handle it

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue is not important enough. We can defer fixing until a better patch will be proposed. In any case please add an explaining comment to your patch when committing it. Otherwise some future code will depend on self.stdin. --

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think PseudoXxxFile should have close methods, but that the methods should not be called when they should not be. Rebinding sys.stdin should not close command line input. My perhaps naive thought is that initializing sys.__stdin__ to the original

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Guilherme Simões
New submission from Guilherme Simões: Something like: sys.stdin = open('file') works in Python but doesn't in the IDLE shell. After trying to do that, a dialog is open asking if the user wants to kill the program. This happens because the method close of the class PseudoInputFile (which was

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Guilherme Simões
Changes by Guilherme Simões gdsimoe...@gmail.com: -- nosy: +Todd.Rovito, roger.serwy, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Once again, what system and version? The Idle user process is different on *nix and Windows -- python.exe versus pythonw.exe. In normal interactive mode, the interpreter continues to take statements from the console, which seems to be sys.__stdin__, after

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Guilherme Simões
Guilherme Simões added the comment: I forgot to say I tested this in MacOS in the development version. It shouldn't happen in earlier versions because the method close of the class PseudoInputFile is not there. A quick fix to this bug would be to just remove this method, but then #17585 would

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Roger Serwy
Roger Serwy added the comment: Are you running with or without a subprocess? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___ ___

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Guilherme Simões
Guilherme Simões added the comment: Roger, I was running with a subprocess but I tried without one and now it works. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17838 ___

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I confirm this bug. Terry, 3.3.1 doesn't contains this bug. This is a regression introduced by issue17585. A right solution is not easy. We should 1) Remove PseudoInputFile.close. 2) Do not print an exception in Executive.runcode, but transfer it via rpc