Index: Lib/test/test_curses.py =================================================================== --- Lib/test/test_curses.py (revision 88145) +++ Lib/test/test_curses.py (working copy) @@ -26,7 +26,7 @@ # XXX: if newterm was supported we could use it instead of initscr and not exit term = os.environ.get('TERM') -if not term or term == 'unknown': +if sys.platform != 'win32' and not term or term == 'unknown': raise unittest.SkipTest("$TERM=%r, calling initscr() may cause exit" % term) if sys.platform == "cygwin": @@ -183,14 +183,16 @@ win = curses.newwin(5,5) win = curses.newwin(5,5, 1,1) curses.nl() ; curses.nl(1) - curses.putp('abc') + if sys.platform != 'win32': + curses.putp('abc') curses.qiflush() curses.raw() ; curses.raw(1) curses.setsyx(5,5) curses.tigetflag('hc') curses.tigetnum('co') curses.tigetstr('cr') - curses.tparm('cr') + if sys.platform != 'win32': + curses.tparm('cr') curses.typeahead(sys.__stdin__.fileno()) curses.unctrl('a') curses.ungetch('a') @@ -291,3 +293,4 @@ if __name__ == '__main__': curses.wrapper(main) unit_tests() + print ('pass') Index: Modules/_cursesmodule.c =================================================================== --- Modules/_cursesmodule.c (revision 88145) +++ Modules/_cursesmodule.c (working copy) @@ -2126,6 +2126,7 @@ } } +#if !defined( WIN32 ) && !defined( _WIN32 ) && !defined( __WIN32__ ) if (!initialised_setupterm && setupterm(termstr,fd,&err) == ERR) { char* s = "setupterm: unknown error"; @@ -2138,6 +2139,7 @@ PyErr_SetString(PyCursesError,s); return NULL; } +#endif initialised_setupterm = TRUE; Index: PC/mkstemp.c =================================================================== --- PC/mkstemp.c (revision 0) +++ PC/mkstemp.c (revision 0) @@ -0,0 +1,43 @@ +/* + mkstemp.c + + provides a windows implementation of mkstemp() by creating a wrapper around + GetTempFileName() + + */ + +#define WIN32_LEAN_AND_MEAN +#define WIN32_EXTRA_LEAN + +#include +#include +#include +#include +#include +#include + +int mkstemp (char * name) +{ + char * chr; + int fd = -1; + errno_t err = _mktemp_s (name, 1 + strlen (name)); + + chr = name; + while (*chr) { + if (*chr == '/') + *chr = '\\'; + chr++; + } + + if (err == 0) { + chr = strrchr (name, '\\'); + if (chr) { + *chr = 0; + _mkdir (name); + *chr = '\\'; + } + fd = _open (name, _O_CREAT| _O_TEMPORARY | _O_RDWR); + } + + return fd; +} Index: PC/pyconfig.h =================================================================== --- PC/pyconfig.h (revision 88145) +++ PC/pyconfig.h (working copy) @@ -761,4 +761,9 @@ least significant byte first */ #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 +/* Other win32 build environments probably provide this */ +#ifdef _MSC_VER +int mkstemp (char * name); +#endif + #endif /* !Py_CONFIG_H */ Index: PCbuild/_curses.vcproj =================================================================== --- PCbuild/_curses.vcproj (revision 0) +++ PCbuild/_curses.vcproj (revision 0) @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: PCbuild/_curses_panel.vcproj =================================================================== --- PCbuild/_curses_panel.vcproj (revision 0) +++ PCbuild/_curses_panel.vcproj (revision 0) @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: PCbuild/pcbuild.sln =================================================================== --- PCbuild/pcbuild.sln (revision 88145) +++ PCbuild/pcbuild.sln (working copy) @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} @@ -137,6 +137,20 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited", "xxlimited.vcproj", "{F749B822-B489-4CA5-A3AD-CE078F5F338A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_curses", "_curses.vcproj", "{8ACDD0E4-575F-47F2-93F7-6687A9917AE9}" + ProjectSection(ProjectDependencies) = postProject + {8780F505-D52B-46B2-AE24-3C2F09650612} = {8780F505-D52B-46B2-AE24-3C2F09650612} + {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pdcurses", "pdcurses.vcproj", "{8780F505-D52B-46B2-AE24-3C2F09650612}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_curses_panel", "_curses_panel.vcproj", "{4D6590EF-1F6B-4958-A2CE-E583801495BC}" + ProjectSection(ProjectDependencies) = postProject + {8780F505-D52B-46B2-AE24-3C2F09650612} = {8780F505-D52B-46B2-AE24-3C2F09650612} + {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -588,6 +602,42 @@ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|Win32.Build.0 = Release|Win32 {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.ActiveCfg = Release|x64 {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.Build.0 = Release|x64 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Debug|Win32.ActiveCfg = Debug|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Debug|Win32.Build.0 = Debug|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Debug|x64.ActiveCfg = Debug|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGInstrument|Win32.ActiveCfg = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGInstrument|Win32.Build.0 = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGInstrument|x64.ActiveCfg = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGUpdate|Win32.ActiveCfg = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGUpdate|Win32.Build.0 = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.PGUpdate|x64.ActiveCfg = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Release|Win32.ActiveCfg = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Release|Win32.Build.0 = Release|Win32 + {8ACDD0E4-575F-47F2-93F7-6687A9917AE9}.Release|x64.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Debug|Win32.ActiveCfg = Debug|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Debug|Win32.Build.0 = Debug|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Debug|x64.ActiveCfg = Debug|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGInstrument|Win32.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGInstrument|Win32.Build.0 = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGInstrument|x64.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGUpdate|Win32.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGUpdate|Win32.Build.0 = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.PGUpdate|x64.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Release|Win32.ActiveCfg = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Release|Win32.Build.0 = Release|Win32 + {8780F505-D52B-46B2-AE24-3C2F09650612}.Release|x64.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Debug|Win32.ActiveCfg = Debug|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Debug|Win32.Build.0 = Debug|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Debug|x64.ActiveCfg = Debug|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGInstrument|Win32.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGInstrument|Win32.Build.0 = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGInstrument|x64.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGUpdate|Win32.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGUpdate|Win32.Build.0 = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.PGUpdate|x64.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Release|Win32.ActiveCfg = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Release|Win32.Build.0 = Release|Win32 + {4D6590EF-1F6B-4958-A2CE-E583801495BC}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Index: PCbuild/pdcurses.vcproj =================================================================== --- PCbuild/pdcurses.vcproj (revision 0) +++ PCbuild/pdcurses.vcproj (revision 0) @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: PCbuild/pythoncore.vcproj =================================================================== --- PCbuild/pythoncore.vcproj (revision 88145) +++ PCbuild/pythoncore.vcproj (working copy) @@ -1,7 +1,7 @@ @@ -266,40 +265,36 @@ /> @@ -344,6 +339,7 @@ /> @@ -423,33 +419,35 @@ @@ -494,6 +492,7 @@ /> + + @@ -883,10 +887,6 @@ > - - @@ -907,10 +907,6 @@ > - - @@ -927,6 +923,10 @@ > + + @@ -1003,6 +1003,10 @@ > + + @@ -1047,6 +1051,10 @@ > + + @@ -1079,10 +1087,6 @@ > - - @@ -1151,10 +1155,6 @@ > - - @@ -1174,35 +1174,35 @@ Name="_io" > @@ -1245,7 +1245,7 @@ /> - - @@ -1710,6 +1706,10 @@ RelativePath="..\PC\pyconfig.h" > + + + + @@ -1847,10 +1851,6 @@ > - - @@ -1863,15 +1863,15 @@ >