1
Vote

Current interactive window is disconnected - please reset the process.

description

Hi,

I have been banging my head against this appearing on my env. (VS 2012, 2.1RC).

I finally figued out how to reproduce it so I thought I'd share.

I am using wxPython and am running in a GUI loop.

If I trap stdout/stderr then I get the error (TRAP_STDOUT_ERR = True) while if I release them then the Python Debug Interactive works as expected.

I hope that helps,

Regards,

Philippe



class out:
def __init__(self):
    '''

    :returns: self
    '''
    sys.stdout = self

def write(self, s):
    '''

    :param s: data to stdout
    :type s: string
    :returns: None
    '''
    f = open('debug.txt','a')
    f.write(s + '\n')
    f.close()
    #raise Exception('print called')
class err:
def __init__(self):
    '''

    :returns: self
    '''
    sys.stderr = self

def write(self, s):
    '''

    :param s: data to stderr
    :type s: string
    :returns: nothing

    '''
    pass

.... in main_
TRAP_STDOUT_ERR = True
if TRAP_STDOUT_ERR:
    outo = out()
    erro = err()

comments