5

I downloaded the source from http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz and with the help of the instructions from http://docs.python.org/devguide/setup.html, I was able to build Python from source.

Now when trying to run the command

C:\Python-2.7.6\PCbuild\pythonw_d.exe c:\Python-2.7.6\Lib\idlelib\idle.py

Nothing shows up.

So I started debugging, by first added a console to the Windows Application via the following code snippet to pythonw\WInMain.c

void RedirectStdoutToNewCOnsole()
{
    HANDLE consoleHandle;
    FILE *fp;
    int fileDescriptor;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    AllocConsole();
    consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
    fileDescriptor = _open_osfhandle((intptr_t)consoleHandle, _O_TEXT);
    fp = _fdopen( fileDescriptor, "w" );
    *stdout = *fp;
    setvbuf( stdout, NULL, _IONBF, 0 );        
    if ( GetConsoleScreenBufferInfo(consoleHandle, &csbi) )
    {
        COORD bufferSize;
        bufferSize.X = csbi.dwSize.X;
        bufferSize.Y = 1000;
        SetConsoleScreenBufferSize(consoleHandle, bufferSize);
    }
}

I was able to see that the source was parsed correctly

Token NAME/'import' ... It's a keyword
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'import_stmt', state 0: Push ...
 DFA 'import_name', state 0: Shift.
Token NAME/'os' ... It's a token we know
 DFA 'import_name', state 1: Push ...
 DFA 'dotted_as_names', state 0: Push ...
 DFA 'dotted_as_name', state 0: Push ...
 DFA 'dotted_name', state 0: Shift.
Token DOT/'.' ... It's a token we know
 DFA 'dotted_name', state 1: Shift.
Token NAME/'path' ... It's a token we know
 DFA 'dotted_name', state 0: Shift.
Token NEWLINE/'' ... It's a token we know
 DFA 'dotted_name', state 1: Pop ...
 DFA 'dotted_as_name', state 1: Pop ...
 DFA 'dotted_as_names', state 1: Pop ...
 DFA 'import_name', state 2: Pop ...
 DFA 'import_stmt', state 1: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NAME/'import' ... It's a keyword
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'import_stmt', state 0: Push ...
 DFA 'import_name', state 0: Shift.
Token NAME/'sys' ... It's a token we know
 DFA 'import_name', state 1: Push ...
 DFA 'dotted_as_names', state 0: Push ...
 DFA 'dotted_as_name', state 0: Push ...
 DFA 'dotted_name', state 0: Shift.
Token NEWLINE/'' ... It's a token we know
 DFA 'dotted_name', state 1: Pop ...
 DFA 'dotted_as_name', state 1: Pop ...
 DFA 'dotted_as_names', state 1: Pop ...
 DFA 'import_name', state 2: Pop ...
 DFA 'import_stmt', state 1: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NAME/'idlelib_dir' ... It's a token we kno
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'expr_stmt', state 0: Push ...
 DFA 'testlist', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token EQUAL/'=' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'testlist', state 1: Pop ...
 DFA 'expr_stmt', state 1: Shift.
Token NAME/'os' ... It's a token we know
 DFA 'expr_stmt', state 3: Push ...
 DFA 'testlist', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'path' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'dirname' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token LPAR/'(' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'os' ... It's a token we know
 DFA 'trailer', state 1: Push ...
 DFA 'arglist', state 0: Push ...
 DFA 'argument', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'path' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'dirname' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token LPAR/'(' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'os' ... It's a token we know
 DFA 'trailer', state 1: Push ...
 DFA 'arglist', state 0: Push ...
 DFA 'argument', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'path' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'abspath' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token LPAR/'(' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'__file__' ... It's a token we know
 DFA 'trailer', state 1: Push ...
 DFA 'arglist', state 0: Push ...
 DFA 'argument', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token RPAR/')' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'argument', state 1: Pop ...
 DFA 'arglist', state 1: Pop ...
 DFA 'trailer', state 4: Shift.
  DFA 'trailer', state 5: Direct pop.
Token RPAR/')' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'argument', state 1: Pop ...
 DFA 'arglist', state 1: Pop ...
 DFA 'trailer', state 4: Shift.
  DFA 'trailer', state 5: Direct pop.
Token RPAR/')' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'argument', state 1: Pop ...
 DFA 'arglist', state 1: Pop ...
 DFA 'trailer', state 4: Shift.
  DFA 'trailer', state 5: Direct pop.
Token NEWLINE/'' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'testlist', state 1: Pop ...
 DFA 'expr_stmt', state 5: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NAME/'sys' ... It's a token we know
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'expr_stmt', state 0: Push ...
 DFA 'testlist', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'path' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'insert' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token LPAR/'(' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NUMBER/'0' ... It's a token we know
 DFA 'trailer', state 1: Push ...
 DFA 'arglist', state 0: Push ...
 DFA 'argument', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token COMMA/',' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'argument', state 1: Pop ...
 DFA 'arglist', state 1: Shift.
Token NAME/'idlelib_dir' ... It's a token we kno
 DFA 'arglist', state 4: Push ...
 DFA 'argument', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token RPAR/')' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'argument', state 1: Pop ...
 DFA 'arglist', state 1: Pop ...
 DFA 'trailer', state 4: Shift.
  DFA 'trailer', state 5: Direct pop.
Token NEWLINE/'' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'testlist', state 1: Pop ...
 DFA 'expr_stmt', state 1: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NAME/'import' ... It's a keyword
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'import_stmt', state 0: Push ...
 DFA 'import_name', state 0: Shift.
Token NAME/'idlelib' ... It's a token we know
 DFA 'import_name', state 1: Push ...
 DFA 'dotted_as_names', state 0: Push ...
 DFA 'dotted_as_name', state 0: Push ...
 DFA 'dotted_name', state 0: Shift.
Token DOT/'.' ... It's a token we know
 DFA 'dotted_name', state 1: Shift.
Token NAME/'PyShell' ... It's a token we know
 DFA 'dotted_name', state 0: Shift.
Token NEWLINE/'' ... It's a token we know
 DFA 'dotted_name', state 1: Pop ...
 DFA 'dotted_as_name', state 1: Pop ...
 DFA 'dotted_as_names', state 1: Pop ...
 DFA 'import_name', state 2: Pop ...
 DFA 'import_stmt', state 1: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NAME/'idlelib' ... It's a token we know
 DFA 'file_input', state 0: Push ...
 DFA 'stmt', state 0: Push ...
 DFA 'simple_stmt', state 0: Push ...
 DFA 'small_stmt', state 0: Push ...
 DFA 'expr_stmt', state 0: Push ...
 DFA 'testlist', state 0: Push ...
 DFA 'test', state 0: Push ...
 DFA 'or_test', state 0: Push ...
 DFA 'and_test', state 0: Push ...
 DFA 'not_test', state 0: Push ...
 DFA 'comparison', state 0: Push ...
 DFA 'expr', state 0: Push ...
 DFA 'xor_expr', state 0: Push ...
 DFA 'and_expr', state 0: Push ...
 DFA 'shift_expr', state 0: Push ...
 DFA 'arith_expr', state 0: Push ...
 DFA 'term', state 0: Push ...
 DFA 'factor', state 0: Push ...
 DFA 'power', state 0: Push ...
 DFA 'atom', state 0: Shift.
  DFA 'atom', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'PyShell' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token DOT/'.' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token NAME/'main' ... It's a token we know
 DFA 'trailer', state 3: Shift.
  DFA 'trailer', state 5: Direct pop.
Token LPAR/'(' ... It's a token we know
 DFA 'power', state 1: Push ...
 DFA 'trailer', state 0: Shift.
Token RPAR/')' ... It's a token we know
 DFA 'trailer', state 1: Shift.
  DFA 'trailer', state 5: Direct pop.
Token NEWLINE/'' ... It's a token we know
 DFA 'power', state 1: Pop ...
 DFA 'factor', state 2: Pop ...
 DFA 'term', state 1: Pop ...
 DFA 'arith_expr', state 1: Pop ...
 DFA 'shift_expr', state 1: Pop ...
 DFA 'and_expr', state 1: Pop ...
 DFA 'xor_expr', state 1: Pop ...
 DFA 'expr', state 1: Pop ...
 DFA 'comparison', state 1: Pop ...
 DFA 'not_test', state 2: Pop ...
 DFA 'and_test', state 1: Pop ...
 DFA 'or_test', state 1: Pop ...
 DFA 'test', state 1: Pop ...
 DFA 'testlist', state 1: Pop ...
 DFA 'expr_stmt', state 1: Pop ...
 DFA 'small_stmt', state 1: Pop ...
 DFA 'simple_stmt', state 1: Shift.
  DFA 'simple_stmt', state 3: Direct pop.
  DFA 'stmt', state 1: Direct pop.
Token NEWLINE/'' ... It's a token we know
 DFA 'file_input', state 0: Shift.
Token ENDMARKER/'' ... It's a token we know
 DFA 'file_input', state 0: Shift.
  DFA 'file_input', state 1: Direct pop.
  ACCEPT.

And was able to trace the call all upto

python27_d.dll!PyEval_EvalCodeEx
python27_d.dll!PyEval_EvalCode
python27_d.dll!run_mod
python27_d.dll!PyRun_FileExFlags
python27_d.dll!PyRun_SimpleFileExFlags
python27_d.dll!PyRun_AnyFileExFlags
python27_d.dll!Py_Main

But then got entangled by the recursive call to PyEval_EvalCodeEx.

Previously, I tried to compare the output from a working release version of pythonw.exe and the failing debug version of pythonw_d.exe through procmon but the effort was not fruitful.

Useful Data

  • 64 bit Windows 7
  • Python 2.7.6 compiled with VC9.0 as 32 bit App

Need help to diagnose or directions to debug the issue.

Abhijit
  • 62,056
  • 18
  • 131
  • 204
  • 3
    Did you also build Tcl/Tk? IDLE requires that. In any case, I expect you'd have better luck on [the Python-Dev mailing list](https://mail.python.org/mailman/listinfo/python-dev). The number of people who routinely build Python on Windows is approximately 0 ;-), but most of those read Python-Dev. – Tim Peters Dec 09 '13 at 00:56
  • Think this may help. Give it a try http://stackoverflow.com/questions/445595/cleanest-way-to-run-debug-python-programs-in-windows – raj3209812 Jan 20 '14 at 06:41

3 Answers3

0

try creating a path to the C: directory by going to Control panel > system and maintenance > advanced system settings > system properties > Environmental variables > and then go to path and add a semi-colon and then the location of the python installed. And then debug.

Chetan
  • 11
  • 2
0

Have you tried the top down approach?

Just start stepping through the code. pdb works like a charm with guis! If you don't know of pdb just think of it as a normal >>> and gdb combined.

So you can print(locals()) and do lots of debugging that many gui debuggers choke on.

C:\Python-2.7.6\PCbuild\pythonw_d.exe -m pdb c:\Python-2.7.6\Lib\idlelib\idle.py

(Pdb) help

Documented commands (type help lt topic gt):
========================================
EOF    cl         disable  interact  next     return  u          where
a      clear      display  j         p        retval  unalias
alias  commands   down     jump      pp       run     undisplay
args   condition  enable   l         print    rv      unt
b      cont       exit     list      q        s       until
break  continue   h        ll        quit     source  up
bt     d          help     longlist  r        step    w
c      debug      ignore   n         restart  tbreak  whatis

Miscellaneous help topics:
==========================
pdb  exec
0

As a Python core developer working on IDLE on Windows, I build python and run repository IDLE a lot, for current Python versions. Here is what I do.

  1. Building: I build fresh pulls from the repository. I use the recommended free MS Visual Studio compilers given in the python.org devguide. For 2.7, this VS2008. I have a minimal svn client installed to get external dependencies. I use PcBuild/build.bat with -e, -d options. This may be new since the question was asked and has always worked and is a great improvement over the former method. When I run python_d.exe (win32/python_d.exe in 3.x) the first time, I pin it to the task bar. The pinned icons continued to work with subsequent rebuilds.

  2. Running IDLE: I usually click the python_d.exe icon and enter >>> import idlelib.idle. The interactive Python console gets warning and error messages. In the console, path\to\python_d.exe -m idlelib.idle (.idle not needed in 3.x) is easier than typing the full idlelib.idle path.

  3. Silent failures: Most have been fixed in the last few years, either by preventing failure or adding an error message. For older versions, one could try deleting the files in $HOME/.idlerc.

Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52