[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- status: open -> closed ___ Python tracker ___ ___

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Import is only needed for the warning issued when someone using IDLE 2.x puts a non-ascii character into code being edited and tries to save without adding an encoding declaration.

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 137c7b92360e by Terry Jan Reedy in branch '2.7': Issue #25507: Add back import needed for 2.x encoding warning box. https://hg.python.org/cpython/rev/137c7b92360e -- status: pending -> open ___ Python

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am thinking about addin a test. -- status: closed -> pending ___ Python tracker ___

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: PS: the test suite run without error on my Win10, 32bit build. -- ___ Python tracker ___

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I decided to fix this issue for both 3.5 and 3.6 by deleting the submodules both from tkinter and sys.modules (as discussed in #27515). I used a new version of tkimports.py to check the result of user imports after the patch. When this file loaded into IDLE

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: run_autocomplete.diff is a preliminary patch for moving the completion list function into run.py and reversing the imports. However, the assert in test_autocomplete, line 103 newly fails because the call to open_completions in autocomplete_event (line 85)

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: In #27515, Nick Coughlin said that 'del a.b', would work if sys.modules('a.b') is also deleted -- unless a.b objects to being reloaded. This seems not a problem for the current 8 tkinter submodules. The attached tkimports.py runs without error. I am not

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: First step. Patch moves 4 objects from pyshell to run and reverses run importing pyshell to pyshell importing run. This initially failed because run imports stackbrowser and the stackbrowser import of something from pyshell failed. Since the import is only

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 93d325c64104 by Terry Jan Reedy in branch 'default': Issue #25507: Move 4 objects from pyshell to run and switch inports. https://hg.python.org/cpython/rev/93d325c64104 -- ___ Python tracker

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: The SO question and that brought the problem to my attention was in June 2015. https://stackoverflow.com/questions/30877112/tkinter-code-using-font-module-cant-run-from-command-line. The message I just unlinked had the wrong url. --

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-14 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- Removed message: http://bugs.python.org/msg259039 ___ Python tracker ___

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: https://stackoverflow.com/questions/38276691/tkinter-nameerror-only-when-running-script-from-shell same problem with filedialog. -- ___ Python tracker

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: According to https://stackoverflow.com/questions/38249755/tkinter-not-working-in-cmd-working-in-idle, this code from tkinter import filedialog root = Tk() ran in 3.4.3. After the patch for 3.5.1 (and 3.4.4, 2.7.11) it raises NameError in 3.5.2. --

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-02-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'import tkinter; tkinter.messagebox' should also fail, but currently work in IDLE. See https://stackoverflow.com/questions/35619027/sub-import-issues-with-tkinter-messagebox, and my answer there. -- ___ Python

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 34ca24fa1b4a by Terry Jan Reedy in branch '2.7': Issue #25507: revert incorrect movement of idleConf import in a37ea1d56e98. https://hg.python.org/cpython/rev/34ca24fa1b4a New changeset 86105a109830 by Terry Jan Reedy in branch '3.5': Issue #25507:

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: -Python 3.4 ___ Python tracker ___ ___

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ouch. Moving the idleConf import was a blunder. It disabled printing in 2.7.11, 3.4.4, and 3.5.1. When I revert, I will also augment the htest to test the printing and save-as functions. Still have to remember to run it though. This sort of functional

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Problem was reported here https://stackoverflow.com/questions/35021370/i-cant-print-from-python-idle-in-windows-10 -- ___ Python tracker

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset a37ea1d56e98 by Terry Jan Reedy in branch '2.7': Issue #25507: move test-specific imports to test function (idlelib.IOBinding). https://hg.python.org/cpython/rev/a37ea1d56e98 New changeset 38b6b7253ba1 by Terry Jan Reedy in branch '3.4': Issue

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-29 Thread Mark Roseman
Mark Roseman added the comment: This (restructuring/refactoring to minimize the subprocess imports) does definitely sound like the right approach. There will be other benefits to breaking up PyShell a bit too.. -- ___ Python tracker

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-29 Thread Terry J. Reedy
New submission from Terry J. Reedy: In python, 'import tkinter; tkinter.font' fails with AttributeError. In IDLE, it does not, which is a bug, This lead to a Stackoverflow question 'Why does my code run in IDLE but not with Python'? The issue is that importing modules in a package has the

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: #8231 will benefit if indirect imports of configHandler and idleConf into the user process can be eliminated. I do not currently believe it is needed. Not importing PyShell will go part way. AutoComplete imports idleConf to get the popup delay. run imports

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: The subprocess command is built in PyShell.ModifiedInterpreter method build_subprocess_arglist (l.404). It imports run and calls run.main(args). The test for this issue would be to import run and check that sys.modules does not contain configHandler and that

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: To continue: CallTips.Calltips has a similar here-or-there logic that decides where to execute the actual get-calltip-logic. In this case, get_entity and get_argspec are already functions rather than methods (I changed get_entity from method to function in