[ python-Bugs-1010370 ] sys.ps1 not protected in EditorWindow.py
SourceForge.net
noreply at sourceforge.net
Tue Aug 17 08:36:15 CEST 2004
Bugs item #1010370, was opened at 2004-08-16 17:15
Message generated for change (Comment added) made by kbk
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1010370&group_id=5470
Category: IDLE
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Florek (d_florek)
Assigned to: Kurt B. Kaiser (kbk)
Summary: sys.ps1 not protected in EditorWindow.py
Initial Comment:
Python 2.3.4 on
Linux <host> 2.4.19-xfs-p3-929 #1 SMP Thu Oct 24
11:29:34 PDT 2002 i686 unknown
(RedHat 7.3, patched)
Auto-indenting fails (and dumps errors to the shell)
when idle is started as a file editor. I've wrapped
original lines 987 and 1057 of EditorWindow.py
(last_line_of_prompt = sys.ps1.split('\n')[-1]) with
if self.context_use_ps1:
last_line_of_prompt = sys.ps1.split('\n')[-1]
else:
last_line_of_prompt = '>>> '
This seems to fix it (might want to double-check other
attempts to access sys.ps1 and make sure they're
likewise protected).
FYI, the errors I got (other than incorrect line
numbers -- I was tracking down a different problem
when I stumbled across this) are:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/lib/python2.3/lib-tk/Tkinter.py",
line 1345, in __call__
return self.func(*args)
File
"/work/florek/dev/python2.3/idlelib/EditorWindow.py",
line 1069, in newline_and_indent_event
last_line_of_prompt = sys.ps1.split('\n')[-1]
AttributeError: 'module' object has no attribute 'ps1'
----------------------------------------------------------------------
>Comment By: Kurt B. Kaiser (kbk)
Date: 2004-08-17 01:36
Message:
Logged In: YES
user_id=149084
When IDLE starts via PyShell.main() sys.ps1 is set
to '>>>' at line 1273. How are you "starting idle as a
file editor?" It may be started either with the idle script
(probably in /usr/bin/ if IDLE was installed from the rpm)
or by calling ../../python ./PyShell.py from .../Lib/idlelib.
Also, take a look at idle.py, it's pretty flexible.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1010370&group_id=5470
More information about the Python-bugs-list
mailing list