This project has moved and is read-only. For the latest updates, please go here.

Issues debugging input statements

Jun 5, 2012 at 3:58 PM

It seems that whenever I try to debug code that contains an "input" command I get the following error:

AttributeError: '_DebuggerOutput' object has no attribute 'errors'

If run outside of visual studio the code runs without issue.  My setup is as follows:

Interpreter: Python 64-bit 3.2

Debug Launch mode: Standard Python launcher

No debug path or arguments have been set

Code Sample:

import os
import re
import xml.parsers.expat

pattern = re.compile('.*\.csproj$')
cont = 'no'

for root, dirs, files in os.walk('C:\\Projects\\src'):
    for name in files:
        if pattern.match(name):
            print(root + '\\' + name)
            cont = input('ct ')
            if cont == 'x':
    if cont == 'x':
input('Press any key to exit')

Has anyone else run into this issue before?


Jun 5, 2012 at 6:35 PM

errors is an undocumented attribute on CPython's file objects, apparently some code relies upon it.  We've updated our code so we'll have this, although I'm not quite sure what release has it (1.5 alpha, or the upcoming 1.5 beta). 

If you'd like to fix it on your own machine you can modify so that the _DebuggerOutput class has an:


    errors = None

Line on it.  You'll find visualstudio_py_debugger in either %LOCALAPPDATA%\Microsoft\VisualStudio\10.0\Extensions\Python Tools for Visual Studio\1.1 or ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Python Tools for Visual Studio\1.1