Commit Graph

42 Commits

Author SHA1 Message Date
Terry Jan Reedy b98000ab5b #13506 Add '' to path for interactive interpreter by adding with_cwd parameter
to PyShell.PyShell.transfer_path() and changing elsewhere as needed.
Original patches by Marco Scataglini and Roger Serwy.
2012-01-31 02:09:25 -05:00
Ned Deily 174c4f897f Issue #8793: Prevent IDLE crash in 2.7 when given strings with
invalid hex escape sequences.
2011-11-15 18:29:02 -08:00
Ronald Oussoren b13cacf677 (backport) Fixes #11088: IDLE crashes when using F5 to run a script on OSX with Tk 8.5
Without this patch IDLE will crash reliably on OSX when Tkinter
is linked to TkCocoa 8.5.x.

To reproduce:

* Create a new file (script.py) with the following two lines:

x = raw_input('prompt: ')
print x

* Save the script

* Run the script using the F5 keyboard shortcut
  (running from the menu works fine)

The patch is a fairly crude hack, but we haven't found a better
workaround for this Tk bug yet.
2011-05-17 15:13:46 +02:00
Kurt B. Kaiser d82a8876f0 Issue #11896: Save on Close failed despite selecting "Yes" in dialog.
Backport 70055:35ed0efd7dd3
2011-05-12 21:18:47 -04:00
Florent Xicluna d630c04ab1 #7092: Fix additional "-3" warnings in the idlelib package, and convert to absolute imports. 2010-04-02 07:24:52 +00:00
Georg Brandl 6634bf2919 Tkinter rename reversal: remove tkinter package, adapt imports and docs. 2008-05-20 07:13:37 +00:00
Georg Brandl ad9afeb8f0 Tkinter rename, step 2: fix imports and add stub modules. 2008-05-16 15:48:15 +00:00
Kurt B. Kaiser e312cfddd3 ScriptBinding event handlers weren't returning 'break'. Patch 2050, Tal Einat. 2008-02-15 21:56:36 +00:00
Kurt B. Kaiser c426ffcdfc Some syntax errors were being caught by tokenize during the tabnanny
check, resulting in obscure error messages.  Do the syntax check
first.  Bug 1562716, 1562719
2006-10-01 21:16:45 +00:00
Kurt B. Kaiser 1fe9ca09a3 Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1) 2006-08-10 01:41:17 +00:00
Kurt B. Kaiser a2946a437e - EditorWindow.test() was failing. Bug 1417598
M    EditorWindow.py
M    ScriptBinding.py
M    NEWS.txt
2006-07-24 18:05:51 +00:00
Kurt B. Kaiser 0cd233f487 Revert previous code elimination, 'filename' is needed. 2005-08-23 03:25:38 +00:00
Kurt B. Kaiser 2618c7fadc 1. Mac line endings were incorrect when pasting code from some browsers
when using X11 and the Fink distribution.  Python Bug 1263656.
2. Eliminate duplicated code in ScriptBinding.run_module_event()
Modified Files:
 	NEWS.txt ScriptBinding.py
2005-08-23 02:27:23 +00:00
Kurt B. Kaiser ca7329c9c1 1. Clarify "tab/space" Error Dialog and "Tab Width" Dialog associated with
the Untabify command.
2. Corrected "tab/space" Error Dialog to show correct menu for Untabify.
   Patch 1196980 Jeff Shute

M EditorWindow.py
M NEWS.txt
M ScriptBinding.py
2005-06-12 05:19:23 +00:00
Kurt B. Kaiser 6af4498602 1. Polish tabbing code.
2. Restore use of set_indentation_params(), was dead code since
   Autoindent.py was merged into EditorWindow.py.
3. Make usetabs, indentwidth, tabwidth, context_use_ps1 instance vars
   and set in EditorWindow.__init__()
4. In PyShell.__init__() set usetabs, indentwidth and context_use_ps1
   explicitly (config() is eliminated).
5. Add Tabnanny check when Module is Run/F5, not just when Checked.
6. Discourage using an indent width other than 8 when using tabs to
   indent Python code.

M EditorWindow.py
M NEWS.txt
M PyShell.py
M ScriptBinding.py
2005-01-19 00:22:59 +00:00
Kurt B. Kaiser 49a5fe107f Redirect the warning stream to the shell during the ScriptBinding check of user code
and format the warning similarly to an exception for both that check and for
warnings raised in the subprocess.

M NEWS.txt
M Pyshell.py
M ScriptBinding.py
M run.py
2004-07-04 01:25:56 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Kurt B. Kaiser af3eb87802 Added a Tk error dialog to run.py inform the user if the subprocess can't
connect to the user GUI process.  Added a timeout to the GUI's listening
socket.  Added Tk error dialogs to PyShell.py to announce a failure to bind
the port or connect to the subprocess.  Clean up error handling during
connection initiation phase.  This is an update of Python Patch 778323.

M NEWS.txt
M PyShell.py
M ScriptBinding.py
M run.py

Backport candidate.
2004-01-21 18:54:30 +00:00
Kurt B. Kaiser 3f8ace9a0f SF 747667 Error Doesn't Decolorize
Also improved error notification if Tabnanny detects a TokenError.

M ScriptBinding
2003-06-05 02:38:32 +00:00
Kurt B. Kaiser ce5b6d55b8 SF 745525
Excecution environment and residual shell has cwd set to the directory of
the module being run.

M ScriptBinding.py
2003-05-31 23:44:18 +00:00
Kurt B. Kaiser 8d1f11b0ef Whitespace Normalization
Modified Files:	PyShell.py ScriptBinding.py buildapp.py
2003-05-26 22:20:34 +00:00
Kurt B. Kaiser 6c638b6755 Bruce Sherwood RFE/Patch
SF 661318

Adds autosave capability to IDLE and IDLE configuration dialog.

User can Run/F5 without explicit save dialog.

The default is to require the user to confirm the save.

M ScriptBinding.py
M config-main.def
M configDialog.py
2003-05-26 06:23:10 +00:00
Kurt B. Kaiser 67fd0ea46d 1. Stake Freddy.
e.g. further improve subprocess interrupt, exceptions, and termination.
2. Remove the workarounds in PyShell.py and ScriptBinding.py involving
   interrupting the subprocess prior to killing it, not necessary anymore.
3. Fix a bug introduced at PyShell Rev 1.66: was getting extra shell menu
   every time the shell window was recreated.

M PyShell.py
M ScriptBinding.py
M rpc.py
M run.py
2003-05-24 20:59:15 +00:00
Kurt B. Kaiser 11659ade1e 1. When a module is run from an EditorWindow, if its directory is not in
sys.path, prepend it.  This allows the module to import other modules
   in the same directory.  Do the same for a script run from the command
   line.
2. Tweak the IDLE usage message a bit more.

SF Bug 706860 (closed)
SF Patch 686254 (reject specific solution)
SF Patch 507327 (similar)

M PyShell.py
M ScriptBinding.py
2003-05-15 23:23:21 +00:00
Kurt B. Kaiser 7f38ec0849 1. Restore the capability to run and debug without a subprocess.
2. Add an indicator to the shell startup notice when running w/o
   subprocess.
3. Improve exception reporting when running a command or script from the
   command line.
4. Clarify the fact that breakpoints set or cleared after a file is
   saved will revert to the saved state if the file is closed without
   re-saving.
5. If user tries to exit or restart when user code is running, interrupt
   the user code.  This helps to eliminate occasional hanging
   subprocesses on Windows (except for Freddy :).

M NEWS.txt
M PyShell.py
M ScriptBinding.py
2003-05-15 03:19:42 +00:00
Kurt B. Kaiser 003091cd51 M NEWS.txt
M PyShell.py
M ScriptBinding.py
M rpc.py
M run.py

Clean up the way IDLEfork handles termination of the subprocess, restore
ability to interrupt user code in Windows (so long as it's doing terminal
I/O).

1. Handle subprocess interrupts in Windows with an RPC message.
2. Run/F5 will restart the subprocess even if user code is running.
3. Restart the subprocess if the link is dropped.
4. Exit IDLE cleanly even during I/O.
4. In rpc.py, remove explicit calls to statelock, let the condition
   variable handle acquire() and release().
2003-02-17 18:57:16 +00:00
Kurt B. Kaiser eb9637ef7d M ScriptBinding.py
M config-extensions.def
M help.txt

1. Run Script  -->  Run Module
2. Update IDLE Help file and do more work on format.
2003-01-26 04:17:16 +00:00
Kurt B. Kaiser a5e8bb94e5 Default the OK key in the Save Before Run dialog. 2003-01-10 03:06:30 +00:00
Kurt B. Kaiser 6655e4bc27 Whitespace Normalization 2002-12-31 16:03:23 +00:00
Kurt B. Kaiser d5e1cef92f If Edit window has not been saved, offer to save if user tries to Run or
Check the module.
2002-12-19 03:25:34 +00:00
Kurt B. Kaiser 92b5ca37c2 M ColorDelegator.py
M PyShell.py
M ScriptBinding.py

1. Update ScriptBinding.py to highlight a syntax error in the Edit window,
   and place the cursor on the error.  Add a syntax check to the
   Run Script event instead of waiting until the script tries to run and
   raises a syntax error in the shell, forcing the user to navigate back
   to the Edit window to fix it.
2. Modify tag_config's appropriately in PyShell.py and ColorDelegator.py
3. Some minor clean-up in ScriptBinding.py
2002-12-17 21:16:12 +00:00
Kurt B. Kaiser 6eadc6cf7e Enable Check Module 2002-12-03 23:09:23 +00:00
Neal Norwitz 6453c1f218 Cleanup:
* Remove unused imports
 * Convert some more 1/0 to True/False
 * Shorten up a long line
2002-11-30 19:18:46 +00:00
Kurt B. Kaiser 05bab1ee93 Merge Py Idle changes:
Rev 1.11 GvR
Fix for SF bug #448835.

Fix this to work with the new (still undocumented) tabnanny API.

I'm afraid Stephen will have to add this fix to the IDLE fork code
base as well.

Rev 1.12 rhettinger
(skip, done differently in Idlefork)

Rev 1.13 time_one
(skip, NA)
2002-09-18 03:05:19 +00:00
Kurt B. Kaiser 63857a454d M PyShell.py
M RemoteDebugger.py
M ScriptBinding.py

Restart the execution server with a clean environment and execute the
active module from scratch upon activation of Run/F5.

Add functionality to PyShell.py to restart the execution server in a new
subprocess.  The server makes a connection to the Idle client which sends a
block of code to be executed.

Modify ScriptBinding.py to restart the subprocess upon Run/F5, assuming that
an execution is not currently in progress.  Remove Import Module functionality,
not required now that the code is executed in a clean environment.

If the Debugger is active, also restart the subprocess side of the split
debugger.  Add functionality to RemoteDebugger.py to support this.

At this time breakpoints will be lost in the subprocess if Run/F5 is activated.
A subsequent checkin of PyShell.py will implement reloading of the breakpoints
into the subprocess debugger.  I'm keeping this separate as the design may
change.
2002-09-05 02:31:20 +00:00
Kurt B. Kaiser adc63847e4 1. Revert subprocess environment clearing, will restart subprocess
instead.
2. Preserve the Idle client's listening socket for reuse with the
   fresh subprocess.
3. Remove some unused rpc code, comment out additional unused code.

Modified Files:
ScriptBinding.py rpc.py run.py
2002-08-25 14:08:07 +00:00
Kurt B. Kaiser d694c1faf9 Reset the Python execution server environment to its initial value prior
to executing Run/F5 from an EditorWindow.

M ScriptBinding.py : add call to clear_the_environment()
M run.py           : implemented Executive.clear_the_environment()
2002-07-28 03:35:31 +00:00
Kurt B. Kaiser 969de458aa Rework the code to have only the GvR RPC. Output from execution of user
code is directed to the Shell.
2002-06-12 03:28:57 +00:00
Chui Tey 5d2af63cc3 GvR's rpc patch 2002-05-26 13:36:41 +00:00
Steven M. Gava 72c3bf076f changeover to new keybinding configuration implementation 2002-01-19 10:41:51 +00:00
Steven M. Gava 42f6c64816 py-cvs merge, better error dialog 2001-07-12 06:46:53 +00:00
David Scherer 7aced17437 Initial revision 2000-08-15 01:13:23 +00:00