Message351562
#38077 fixed the bug of internal runcommand code not deleting 'argv' from the user namespace. This issue is about not running code there.
When a subprocess is running, pyshell.ModifiedInterpreter.runcommand runs python code created by IDLE in locals == __main__.__dict__, the same as code enter by a user. This requires that the code carefully clean up after itself. I believe the same effect could by had more safely by exec-ing internal commands in the run module dict or a fresh temporary dict.
Possible solution. In run.Executive.runcode, add 'user=True' to runcode signature, add 'if user else {}' to 'self.locals' arg, and add
def runcommand(self, code):
return self.runcode(code, user=False). Then replace 'runcode' with 'runcommand' in pyshell runcommand body. |
|
Date |
User |
Action |
Args |
2019-09-10 01:37:51 | terry.reedy | set | recipients:
+ terry.reedy |
2019-09-10 01:37:51 | terry.reedy | set | messageid: <1568079471.24.0.207748043003.issue38078@roundup.psfhosted.org> |
2019-09-10 01:37:51 | terry.reedy | link | issue38078 messages |
2019-09-10 01:37:50 | terry.reedy | create | |
|