This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Tutorial issue regarding the sys module
Type: behavior Stage: needs patch
Components: IDLE Versions: Python 2.6
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE doesn't recognize resetting sys.ps1.
View: 13657
Assigned To: Nosy List: LucianU, brian.curtin, georg.brandl, roger.serwy, ronaldoussoren
Priority: normal Keywords:

Created on 2010-02-18 14:58 by LucianU, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg99510 - (view) Author: Lucian Ursu (LucianU) Date: 2010-02-18 14:58

I've discovered an issue while reading the Python tutorial. In chapter 6.2. "Standard Modules", the tutorial mentions the "sys" module and two of its attributes, ps1='<<<' and ps2='...'. The problem is I can't find these attributes in my version of Python (2.6.4.) when I do "dir(sys)". Have these attributes been deprecated but not removed from the tutorial yet?
Thank you for your time.
msg99511 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-02-18 15:28
That's odd, they should exist and do for me:

Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.ps1
'>>> '
>>> sys.ps2
'... '
msg99513 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-02-18 15:32
They exist only in interactive mode.  They won't be present if you do e.g.

python -c "import sys; print dir(sys)"
msg99514 - (view) Author: Lucian Ursu (LucianU) Date: 2010-02-18 15:47
Then it must be an issue with my Python. This is what I get. 
>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_traceback', 'exc_type', 'exc_value', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'getwindowsversion', 'hexversion', 'last_traceback', 'last_type', 'last_value', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'py3kwarning', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions', 'winver']
>>> sys.ps1

Traceback (most recent call last):
  File "<pyshell#23>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ps1'
msg99516 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-02-18 16:08
This is a problem in IDLE -- notice the file referred to in the traceback.
msg99535 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-02-18 22:04
Ah. Well, I still don't think it's a bug, but that's for the IDLE maintainer to decide.
msg165559 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-07-16 00:34
IDLE supporting sys.ps1 and sys.ps2 is discussed in issue13657. I am closing this issue in favor of that one.
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52205
2012-07-16 00:34:32roger.serwysetstatus: open -> closed

nosy: + roger.serwy
messages: + msg165559

superseder: IDLE doesn't recognize resetting sys.ps1.
resolution: duplicate
2010-02-18 22:04:59georg.brandlsetmessages: + msg99535
2010-02-18 16:08:54brian.curtinsetstatus: closed -> open

type: behavior
assignee: georg.brandl ->
components: + IDLE, - Documentation

nosy: + brian.curtin
messages: + msg99516
resolution: wont fix -> (no value)
stage: needs patch
2010-02-18 15:47:03LucianUsetmessages: + msg99514
2010-02-18 15:32:19georg.brandlsetstatus: open -> closed
resolution: wont fix
messages: + msg99513
2010-02-18 15:28:40ronaldoussorensetnosy: + ronaldoussoren
messages: + msg99511
2010-02-18 14:58:26LucianUcreate