Message9738

Author Arfrever
Recipients Arfrever, zyasoft
Date 2015-03-30.19:54:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427745286.68.0.429988904319.issue2305@psf.upfronthosting.co.za>
In-reply-to
Content
Since https://hg.python.org/jython/rev/23c3effa5d4f sys.ps1 and sys.ps2 do not exist in non-interactive mode but they are still mentioned in dir(sys):

$ jython2.7 -c 'import sys; print(dir(sys))'
['JYTHON_DEV_JAR', 'JYTHON_JAR', 'PYTHON_CACHEDIR', 'PYTHON_CACHEDIR_SKIP', 'PYTHON_CONSOLE_ENCODING', 'PYTHON_IO_ENCODING', 'PYTHON_IO_ERRORS', '__delattr__', '__dict__', '__displayhook__', '__excepthook__', '__findattr_ex__', '__name__', '__new__', '__rawdir__', '__setattr__', '__stderr__', '__stdin__', '__stdout__', '_getframe', '_jy_console', '_mercurial', '_systemRestart', 'add_classdir', 'add_extdir', 'add_package', 'argv', 'builtin_module_names', 'builtins', 'byteorder', 'classDictInit', 'classLoader', 'cleanup', 'close', 'codecState', 'copyright', 'currentWorkingDir', 'defaultencoding', 'displayhook', 'doInitialize', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'filesystemencoding', 'flags', 'float_info', 'float_repr_style', 'getBaseProperties', 'getBuiltin', 'getBuiltins', 'getClassLoader', 'getCodecState', 'getCurrentWorkingDir', 'getDefaultBuiltins', 'getFile', 'getImportLock', 'getPath', 'getPathLazy', 'getPlatform', 'getSyspathJavaLoader', 'getWarnoptions', 'getdefaultencoding', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'gettrace', 'hexversion', 'importLock', 'initialize', 'isPackageCacheEnabled', 'last_traceback', 'last_type', 'last_value', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'minint', 'modules', 'modules_reloading', 'packageManager', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'py3kwarning', 'recursionlimit', 'refersDirectlyTo', 'registerCloser', 'registry', 'setBuiltins', 'setClassLoader', 'setCurrentWorkingDir', 'setPlatform', 'setWarnoptions', 'setprofile', 'setrecursionlimit', 'settrace', 'shadow', 'stderr', 'stdin', 'stdout', 'subversion', 'syspathJavaLoader', 'toString', 'traverse', 'unregisterCloser', 'version', 'version_info', 'warnoptions']
$ jython2.7 -c 'import sys; print(sys.ps1)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: '<reflected field public org.python.core.PyObject o' object has no attribute 'ps1'
$ jython2.7 -c 'import sys; print(sys.ps2)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: '<reflected field public org.python.core.PyObject o' object has no attribute 'ps2'


In CPython:

$ python2.7 -c 'import sys; print(dir(sys))'
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'py3kwarning', 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
$ python2.7 -c 'import sys; print(sys.ps1)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ps1'
$ python2.7 -c 'import sys; print(sys.ps2)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ps2'
History
Date User Action Args
2015-03-30 19:54:46Arfreversetrecipients: + Arfrever, zyasoft
2015-03-30 19:54:46Arfreversetmessageid: <1427745286.68.0.429988904319.issue2305@psf.upfronthosting.co.za>
2015-03-30 19:54:46Arfreverlinkissue2305 messages
2015-03-30 19:54:45Arfrevercreate