Author brunteman
Recipients brunteman
Date 2015-09-14.14:12:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When creating an interactive tool using jython 2.7.0 and the cmd module, tab completion will give this error:

Traceback (most recent call last):
  File "", line 251, in <module>
  File "/home/user/devtools/jython2.7.0/Lib/", line 130, in cmdloop
    line = raw_input(self.prompt)
  File "/home/user/devtools/jython2.7.0/Lib/", line 130, in cmdloop
    line = raw_input(self.prompt)
  File "/home/user/devtools/jython2.7.0/Lib/", line 120, in complete_handler
    if _reader.prompt == sys.ps2 and (not delimited or delimited.isspace()):
AttributeError: '<reflected field public org.python.core.PyObject o' object has no attribute 'ps2'

I worked around the problem by changing the line to:
if _reader.prompt == getattr(sys, 'ps2', None) and (not delimited or delimited.isspace()):

But I suppose that it should in fact be fixed elsewhere. sys.ps2 is set in interactive mode, but I am not sure if an cmd application counts as that.

Recreating the problem was easy, Just run this code and hit TAB:

import cmd

class HelloWorld(cmd.Cmd):

if __name__ == '__main__':
Date User Action Args
2015-09-14 14:12:51bruntemansetrecipients: + brunteman
2015-09-14 14:12:51bruntemansetmessageid: <>
2015-09-14 14:12:51bruntemanlinkissue2398 messages
2015-09-14 14:12:50bruntemancreate