[ python-Bugs-1010370 ] sys.ps1 not protected in EditorWindow.py

SourceForge.net noreply at sourceforge.net
Tue Aug 17 07:39:20 CEST 2004


Bugs item #1010370, was opened at 2004-08-16 18:15
Message generated for change (Settings changed) made by nnorwitz
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'



----------------------------------------------------------------------

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