[Eric] Re: eric 4.1.1 interactive python console problem

Melissa melissalrice at hotmail.com
Mon Apr 14 07:55:45 BST 2008

Detlev Offenbach <detlev at ...> writes:

> can you please check, if the IDE is listening on a port? Can you try to start 
> the debugger backend manually via the shell context menu 'Start->Python' 
> entry?

As far as I can see (netstat -b) there is nothing listening on a port that
appears related to Eric or Python. Do you know how it would be identified? Or
which port it would use?

Running from a console window the only error messages I see are related to it
not finding some Qt translation files, which is fine because the default seems
to be English, which is working for me. 

I manually executed DebugServer.py, if that's what you meant by the debugger
backend. No error message or anything but the console window disappear before I
could see what was going on. <grrr windows...> Perhaps tomorrow I can try to run
the code piece by piece and see what's failing....

In the meantime do you know any small tests I can do to isolate the problem?

Here are the bits of code from the call stack where the exception occurred:

Here is where the exception is thrown (see line marked "fails here"):

    def connectDebugger(self,port,remoteAddress=None,redirect=1):
        Public method to establish a session with the debugger. 
        It opens a network connection to the debugger, connects it to stdin, 
        stdout and stderr and saves these file objects in case the application
        being debugged redirects them itself.
        @param port the port number to connect to (int)
        @param remoteAddress the network address of the debug server host
        @param redirect flag indicating redirection of stdin, stdout and stderr 
        sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
        if remoteAddress is None:
            sock.connect((DebugAddress,port)) # fails here

        self.readstream = AsyncFile(sock,sys.stdin.mode,sys.stdin.name)
        self.writestream = AsyncFile(sock,sys.stdout.mode,sys.stdout.name)
        self.errorstream = AsyncFile(sock,sys.stderr.mode,sys.stderr.name)
        if redirect:
            sys.stdin = self.readstream
            sys.stdout = self.writestream
            sys.stderr = self.errorstream
        self.redirect = redirect
        # attach to the main thread here

This is called from (see line marked "fails here"):

    def main(self):
        Public method implementing the main method.
        if '--' in sys.argv:
            args = sys.argv[1:]
            host = None
            port = None
            wd = ''
            tracePython = 0
            exceptions = 1
            redirect = 1
            while args[0]:
                if args[0] == '-h':
                    host = args[1]
                    del args[0]
                    del args[0]
                elif args[0] == '-p':
                    port = args[1]
                    del args[0]
                    del args[0]
                elif args[0] == '-w':
                    wd = args[1]
                    del args[0]
                    del args[0]
                elif args[0] == '-t':
                    tracePython = 1
                    del args[0]
                elif args[0] == '-e':
                    exceptions = 0
                    del args[0]
                elif args[0] == '-n':
                    redirect = 0
                    del args[0]
                elif args[0] == '--no-encoding':
                    self.noencoding = True
                    del args[0]
                elif args[0] == '--':
                    del args[0]
                else:   # unknown option
                    del args[0]
            if not args:
                print "No program given. Aborting!"
                if not self.noencoding:
                    self.__coding = self.defaultCoding
##                    try:
##                        sys.setappdefaultencoding(self.defaultCoding)
##                    except AttributeError:
##                        pass
                self.startProgInDebugger(args, wd, host, port, 
            if sys.argv[1] == '--no-encoding':
                self.noencoding = True
                del sys.argv[1]
            if sys.argv[1] == '':
                del sys.argv[1]
                port = long(sys.argv[1])
                port = -1
                redirect = int(sys.argv[2])
                redirect = 1
                remoteAddress = sys.argv[3]
                remoteAddress = None
            sys.argv = ['']
            if not '' in sys.path:
                sys.path.insert(0, '')
            if port >= 0:
                if not self.noencoding:
                    self.__coding = self.defaultCoding
##                    try:
##                        sys.setappdefaultencoding(self.defaultCoding)
##                    except AttributeError:
##                        pass
                self.connectDebugger(port, remoteAddress, redirect) # fails here
                print "No network port given. Aborting..."

This is called from the marked line below:

# We are normally called by the debugger to execute directly.

if __name__ == '__main__':
    debugClient = DebugClientThreads()
    debugClient.main() # failed here

This is the error message in the eric error log file:

2008-04-13, 23:19:00
'NoneType' object has no attribute 'remoteStatement'
  File "C:\apps\Python\Lib\site-packages\eric4\ViewManager\ViewManager.py", line
4308, in __editorCommand
  File "C:\apps\Python\Lib\site-packages\eric4\QScintilla\Shell.py", line 613,
in editorCommand
  File "C:\apps\Python\Lib\site-packages\eric4\QScintilla\Shell.py", line 761,
in __QScintillaNewline
  File "C:\apps\Python\Lib\site-packages\eric4\QScintilla\Shell.py", line 1007,
in __executeCommand
  File "C:\apps\Python\Lib\site-packages\eric4\Debugger\DebugServer.py", line
690, in remoteStatement

Version Numbers:
  Python 2.4.5
  Qt 4.3.3
  PyQt4 4.3.3
  sip 4.7.4
  QScintilla 2.2
  eric4 4.1.2 (r2105)

Platform: win32
2.4.5 (#71, Mar 26 2008, 17:55:58) [MSC v.1310 32 bit (Intel)]



More information about the Eric mailing list