From: Georg Brandl Date: Sat, 5 Mar 2011 14:02:28 +0000 (+0100) Subject: Add .hgeol file and fix newlines in the 2.5 branch. X-Git-Tag: v2.5.6c1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4db2c257d604b9f39d7431de9593d974a671aeb5;p=python Add .hgeol file and fix newlines in the 2.5 branch. --- diff --git a/.hgeol b/.hgeol new file mode 100644 index 0000000000..e1c19926a8 --- /dev/null +++ b/.hgeol @@ -0,0 +1,39 @@ +[patterns] + +# Non human-editable files are binary + +**.dsp = BIN +**.dsw = BIN +**.mk = BIN +**.sln = BIN +**.vcproj = BIN +**.vsprops = BIN + +**.aif = BIN +**.au = BIN +**.bmp = BIN +**.db = BIN +**.exe = BIN +**.icns = BIN +**.gif = BIN +**.ico = BIN +**.info = BIN +**.jpg = BIN +**.pck = BIN +**.png = BIN +**.psd = BIN +**.tar = BIN +**.xar = BIN +**.zip = BIN + +Lib/email/test/data/msg_26.txt = BIN +Lib/test/sndhdrdata/sndhdr.* = BIN +Lib/test/decimaltestdata/*.decTest = BIN + +# All other files (which presumably are human-editable) are "native". +# This must be the last rule! + +** = native + +[repository] +native = LF diff --git a/Doc/lib/xmletree.tex b/Doc/lib/xmletree.tex index 789062d81d..c5544727fa 100644 --- a/Doc/lib/xmletree.tex +++ b/Doc/lib/xmletree.tex @@ -1,27 +1,27 @@ -\section{\module{xml.etree} --- - The ElementTree API for XML} - -\declaremodule{standard}{xml.etree} -\modulesynopsis{Package containing common ElementTree modules.} -\moduleauthor{Fredrik Lundh}{fredrik@pythonware.com} - -\versionadded{2.5} - -The ElementTree package is a simple, efficient, and quite popular -library for XML manipulation in Python. - -The \module{xml.etree} package contains the most common components -from the ElementTree API library. -In the current release, this package contains the \module{ElementTree}, -\module{ElementPath}, and \module{ElementInclude} modules from the full -ElementTree distribution. - -% XXX To be continued! - -\begin{seealso} -\seetitle[http://effbot.org/tag/elementtree] - {ElementTree Overview} - {The home page for \module{ElementTree}. This includes links - to additional documentation, alternative implementations, and - other add-ons.} -\end{seealso} +\section{\module{xml.etree} --- + The ElementTree API for XML} + +\declaremodule{standard}{xml.etree} +\modulesynopsis{Package containing common ElementTree modules.} +\moduleauthor{Fredrik Lundh}{fredrik@pythonware.com} + +\versionadded{2.5} + +The ElementTree package is a simple, efficient, and quite popular +library for XML manipulation in Python. + +The \module{xml.etree} package contains the most common components +from the ElementTree API library. +In the current release, this package contains the \module{ElementTree}, +\module{ElementPath}, and \module{ElementInclude} modules from the full +ElementTree distribution. + +% XXX To be continued! + +\begin{seealso} +\seetitle[http://effbot.org/tag/elementtree] + {ElementTree Overview} + {The home page for \module{ElementTree}. This includes links + to additional documentation, alternative implementations, and + other add-ons.} +\end{seealso} diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py index 1a85f3baff..a7445f329a 100644 --- a/Lib/test/test_pep263.py +++ b/Lib/test/test_pep263.py @@ -1,31 +1,31 @@ -#! -*- coding: koi8-r -*- -# This file is marked as binary in SVN, to prevent MacCVS from recoding it. - -import unittest -from test import test_support - -class PEP263Test(unittest.TestCase): - - def test_pep263(self): - self.assertEqual( - u"ðÉÔÏÎ".encode("utf-8"), - '\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' - ) - self.assertEqual( - u"\ð".encode("utf-8"), - '\\\xd0\x9f' - ) - - def test_compilestring(self): - # see #1882 - c = compile("\n# coding: utf-8\nu = u'\xc3\xb3'\n", "dummy", "exec") - d = {} - exec c in d - self.assertEqual(d['u'], u'\xf3') - - -def test_main(): - test_support.run_unittest(PEP263Test) - -if __name__=="__main__": - test_main() +#! -*- coding: koi8-r -*- +# This file is marked as binary in SVN, to prevent MacCVS from recoding it. + +import unittest +from test import test_support + +class PEP263Test(unittest.TestCase): + + def test_pep263(self): + self.assertEqual( + u"ðÉÔÏÎ".encode("utf-8"), + '\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' + ) + self.assertEqual( + u"\ð".encode("utf-8"), + '\\\xd0\x9f' + ) + + def test_compilestring(self): + # see #1882 + c = compile("\n# coding: utf-8\nu = u'\xc3\xb3'\n", "dummy", "exec") + d = {} + exec c in d + self.assertEqual(d['u'], u'\xf3') + + +def test_main(): + test_support.run_unittest(PEP263Test) + +if __name__=="__main__": + test_main() diff --git a/PCbuild/build_ssl.bat b/PCbuild/build_ssl.bat index 82572ed18a..4923a8f156 100644 --- a/PCbuild/build_ssl.bat +++ b/PCbuild/build_ssl.bat @@ -1,10 +1,10 @@ -@echo off -if not defined HOST_PYTHON ( - if %1 EQU Debug ( - set HOST_PYTHON=python_d.exe - ) ELSE ( - set HOST_PYTHON=python.exe - ) -) -%HOST_PYTHON% build_ssl.py %1 %2 - +@echo off +if not defined HOST_PYTHON ( + if %1 EQU Debug ( + set HOST_PYTHON=python_d.exe + ) ELSE ( + set HOST_PYTHON=python.exe + ) +) +%HOST_PYTHON% build_ssl.py %1 %2 + diff --git a/PCbuild8/_ctypes/masm64.rules b/PCbuild8/_ctypes/masm64.rules index d25d86c534..bc1cffdeb8 100644 --- a/PCbuild8/_ctypes/masm64.rules +++ b/PCbuild8/_ctypes/masm64.rules @@ -1,305 +1,305 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PCbuild8/build.bat b/PCbuild8/build.bat index 8c61a70313..9b84bf5f84 100644 --- a/PCbuild8/build.bat +++ b/PCbuild8/build.bat @@ -1,17 +1,17 @@ -@echo off -rem A batch program to build or rebuild a particular configuration. -rem just for convenience. - -setlocal -set platf=Win32 -set conf=Release -set build=/build - -:CheckOpts -if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts -if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts -if "%1"=="-r" (set build=/rebuild) & shift & goto CheckOpts - -set cmd=devenv pcbuild.sln %build% "%conf%|%platf%" -echo %cmd% +@echo off +rem A batch program to build or rebuild a particular configuration. +rem just for convenience. + +setlocal +set platf=Win32 +set conf=Release +set build=/build + +:CheckOpts +if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts +if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts +if "%1"=="-r" (set build=/rebuild) & shift & goto CheckOpts + +set cmd=devenv pcbuild.sln %build% "%conf%|%platf%" +echo %cmd% %cmd% \ No newline at end of file diff --git a/PCbuild8/build_pgo.bat b/PCbuild8/build_pgo.bat index ec85323f23..7c2d9716a7 100644 --- a/PCbuild8/build_pgo.bat +++ b/PCbuild8/build_pgo.bat @@ -1,39 +1,39 @@ -@echo off -rem A batch program to build PGO (Profile guided optimization) by first -rem building instrumented binaries, then running the testsuite, and -rem finally building the optimized code. -rem Note, after the first instrumented run, one can just keep on -rem building the PGUpdate configuration while developing. - -setlocal -set platf=Win32 - -rem use the performance testsuite. This is quick and simple -set job1=..\tools\pybench\pybench.py -n 1 -C 1 --with-gc -set path1=..\tools\pybench - -rem or the whole testsuite for more thorough testing -set job2=..\lib\test\regrtest.py -set path2=..\lib - -set job=%job1% -set clrpath=%path1% - -:CheckOpts -if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts -if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts - -set folder=%platf%PGO - - -@echo on -rem build the instrumented version -call build -r -p %platf% -c PGInstrument - -rem remove .pyc files, .pgc files and execute the job -%folder%\python.exe rmpyc.py %clrpath% -del %folder%\*.pgc -%folder%\python.exe %job% - -rem finally build the optimized version -call build -r -p %platf% -c PGUpdate +@echo off +rem A batch program to build PGO (Profile guided optimization) by first +rem building instrumented binaries, then running the testsuite, and +rem finally building the optimized code. +rem Note, after the first instrumented run, one can just keep on +rem building the PGUpdate configuration while developing. + +setlocal +set platf=Win32 + +rem use the performance testsuite. This is quick and simple +set job1=..\tools\pybench\pybench.py -n 1 -C 1 --with-gc +set path1=..\tools\pybench + +rem or the whole testsuite for more thorough testing +set job2=..\lib\test\regrtest.py +set path2=..\lib + +set job=%job1% +set clrpath=%path1% + +:CheckOpts +if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts +if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts + +set folder=%platf%PGO + + +@echo on +rem build the instrumented version +call build -r -p %platf% -c PGInstrument + +rem remove .pyc files, .pgc files and execute the job +%folder%\python.exe rmpyc.py %clrpath% +del %folder%\*.pgc +%folder%\python.exe %job% + +rem finally build the optimized version +call build -r -p %platf% -c PGUpdate diff --git a/PCbuild8/make_buildinfo/make_buildinfo.c b/PCbuild8/make_buildinfo/make_buildinfo.c index 6f89716c3b..2d76abc4a8 100644 --- a/PCbuild8/make_buildinfo/make_buildinfo.c +++ b/PCbuild8/make_buildinfo/make_buildinfo.c @@ -1,66 +1,66 @@ -#include -#include -#include -#include - -/* This file creates the local getbuildinfo.c file, by - invoking subwcrev.exe (if found). This replaces tokens - int the file with information about the build. - If this isn't a subversion checkout, or subwcrev isn't - found, it copies ..\\Modules\\getbuildinfo.c instead. - - Currently, subwcrev.exe is found from the registry entries - of TortoiseSVN. - - make_buildinfo.exe is called as a pre-build step for pythoncore. -*/ - -int make_buildinfo2() -{ - struct _stat st; - HKEY hTortoise; - char command[500]; - DWORD type, size; - if (_stat("..\\.svn", &st) < 0) - return 0; - /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */ - if (_stat("no_subwcrev", &st) == 0) - return 0; - if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS && - RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS) - /* Tortoise not installed */ - return 0; - command[0] = '"'; /* quote the path to the executable */ - size = sizeof(command) - 1; - if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS || - type != REG_SZ) - /* Registry corrupted */ - return 0; - strcat_s(command, sizeof(command), "bin\\subwcrev.exe"); - if (_stat(command+1, &st) < 0) - /* subwcrev.exe not part of the release */ - return 0; - strcat_s(command, sizeof(command), "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo.c"); - puts(command); fflush(stdout); - if (system(command) < 0) - return 0; - return 1; -} - -int main(int argc, char*argv[]) -{ - char command[500] = ""; - int svn; - /* Get getbuildinfo.c from svn as getbuildinfo2.c */ - svn = make_buildinfo2(); - if (svn) { - puts("subcwrev succeeded, generated getbuildinfo.c"); - } else { - puts("Couldn't run subwcrev.exe on getbuildinfo.c. Copying it"); - strcat_s(command, sizeof(command), "copy /Y ..\\Modules\\getbuildinfo.c getbuildinfo.c"); - puts(command); fflush(stdout); - if (system(command) < 0) - return EXIT_FAILURE; - } - return 0; +#include +#include +#include +#include + +/* This file creates the local getbuildinfo.c file, by + invoking subwcrev.exe (if found). This replaces tokens + int the file with information about the build. + If this isn't a subversion checkout, or subwcrev isn't + found, it copies ..\\Modules\\getbuildinfo.c instead. + + Currently, subwcrev.exe is found from the registry entries + of TortoiseSVN. + + make_buildinfo.exe is called as a pre-build step for pythoncore. +*/ + +int make_buildinfo2() +{ + struct _stat st; + HKEY hTortoise; + char command[500]; + DWORD type, size; + if (_stat("..\\.svn", &st) < 0) + return 0; + /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */ + if (_stat("no_subwcrev", &st) == 0) + return 0; + if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS && + RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS) + /* Tortoise not installed */ + return 0; + command[0] = '"'; /* quote the path to the executable */ + size = sizeof(command) - 1; + if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS || + type != REG_SZ) + /* Registry corrupted */ + return 0; + strcat_s(command, sizeof(command), "bin\\subwcrev.exe"); + if (_stat(command+1, &st) < 0) + /* subwcrev.exe not part of the release */ + return 0; + strcat_s(command, sizeof(command), "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo.c"); + puts(command); fflush(stdout); + if (system(command) < 0) + return 0; + return 1; +} + +int main(int argc, char*argv[]) +{ + char command[500] = ""; + int svn; + /* Get getbuildinfo.c from svn as getbuildinfo2.c */ + svn = make_buildinfo2(); + if (svn) { + puts("subcwrev succeeded, generated getbuildinfo.c"); + } else { + puts("Couldn't run subwcrev.exe on getbuildinfo.c. Copying it"); + strcat_s(command, sizeof(command), "copy /Y ..\\Modules\\getbuildinfo.c getbuildinfo.c"); + puts(command); fflush(stdout); + if (system(command) < 0) + return EXIT_FAILURE; + } + return 0; } \ No newline at end of file diff --git a/PCbuild8/rt.bat b/PCbuild8/rt.bat index 8927879d5e..78e5d8004a 100644 --- a/PCbuild8/rt.bat +++ b/PCbuild8/rt.bat @@ -1,59 +1,59 @@ -@echo off -rem Run Tests. Run the regression test suite. -rem Usage: rt [-d] [-O] [-q] regrtest_args -rem -d Run Debug build (python_d.exe). Else release build. -rem -pgo Run PGO build, e.g. for instrumentation -rem -x64 Run the x64 version, otherwise win32 -rem -O Run python.exe or python_d.exe (see -d) with -O. -rem -q "quick" -- normally the tests are run twice, the first time -rem after deleting all the .py[co] files reachable from Lib/. -rem -q runs the tests just once, and without deleting .py[co] files. -rem All leading instances of these switches are shifted off, and -rem whatever remains is passed to regrtest.py. For example, -rem rt -O -d -x test_thread -rem runs -rem python_d -O ../lib/test/regrtest.py -x test_thread -rem twice, and -rem rt -q -g test_binascii -rem runs -rem python_d ../lib/test/regrtest.py -g test_binascii -rem to generate the expected-output file for binascii quickly. -rem -rem Confusing: if you want to pass a comma-separated list, like -rem -u network,largefile -rem then you have to quote it on the rt line, like -rem rt -u "network,largefile" - -setlocal - -set platf=win32 -set exe=python.exe -set qmode= -set dashO= -set conf=Release -PATH %PATH%;..\..\tcltk\bin - -:CheckOpts -if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts -if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts -if "%1"=="-d" (set exe=python_d.exe) & (set conf=Debug) & shift & goto CheckOpts -if "%1"=="-x64" (set platf=x64) & shift & goto CheckOpts -if "%1"=="-pgo" (set conf=PGO) & shift & goto CheckOpts - -set exe=%platf%%conf%\%exe% -set cmd=%exe% %dashO% -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 -if defined qmode goto Qmode - -echo Deleting .pyc/.pyo files ... -%exe% rmpyc.py - -echo on -%cmd% -@echo off - -echo About to run again without deleting .pyc/.pyo first: -pause - -:Qmode -echo on -%cmd% +@echo off +rem Run Tests. Run the regression test suite. +rem Usage: rt [-d] [-O] [-q] regrtest_args +rem -d Run Debug build (python_d.exe). Else release build. +rem -pgo Run PGO build, e.g. for instrumentation +rem -x64 Run the x64 version, otherwise win32 +rem -O Run python.exe or python_d.exe (see -d) with -O. +rem -q "quick" -- normally the tests are run twice, the first time +rem after deleting all the .py[co] files reachable from Lib/. +rem -q runs the tests just once, and without deleting .py[co] files. +rem All leading instances of these switches are shifted off, and +rem whatever remains is passed to regrtest.py. For example, +rem rt -O -d -x test_thread +rem runs +rem python_d -O ../lib/test/regrtest.py -x test_thread +rem twice, and +rem rt -q -g test_binascii +rem runs +rem python_d ../lib/test/regrtest.py -g test_binascii +rem to generate the expected-output file for binascii quickly. +rem +rem Confusing: if you want to pass a comma-separated list, like +rem -u network,largefile +rem then you have to quote it on the rt line, like +rem rt -u "network,largefile" + +setlocal + +set platf=win32 +set exe=python.exe +set qmode= +set dashO= +set conf=Release +PATH %PATH%;..\..\tcltk\bin + +:CheckOpts +if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts +if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts +if "%1"=="-d" (set exe=python_d.exe) & (set conf=Debug) & shift & goto CheckOpts +if "%1"=="-x64" (set platf=x64) & shift & goto CheckOpts +if "%1"=="-pgo" (set conf=PGO) & shift & goto CheckOpts + +set exe=%platf%%conf%\%exe% +set cmd=%exe% %dashO% -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +if defined qmode goto Qmode + +echo Deleting .pyc/.pyo files ... +%exe% rmpyc.py + +echo on +%cmd% +@echo off + +echo About to run again without deleting .pyc/.pyo first: +pause + +:Qmode +echo on +%cmd% diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat index 463285fa49..c375dcda7a 100644 --- a/Tools/buildbot/external.bat +++ b/Tools/buildbot/external.bat @@ -1,36 +1,36 @@ -@rem Fetches (and builds if necessary) external dependencies - -@rem Assume we start inside the Python source directory -cd .. -call "%VS71COMNTOOLS%vsvars32.bat" - -@rem bzip -if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3 - -@rem Sleepycat db -if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20 -if not exist db-4.4.20\build_win32\debug\libdb44sd.lib ( - devenv db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static -) - -@rem OpenSSL -if not exist openssl-0.9.8a svn export http://svn.python.org/projects/external/openssl-0.9.8a - -@rem tcltk -if not exist tcl8.4.12 ( - if exist tcltk rd /s/q tcltk - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - cd tcl8.4.12\win - nmake -f makefile.vc - nmake -f makefile.vc INSTALLDIR=..\..\tcltk install - cd ..\.. - cd tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install - cd ..\.. -) - -@rem sqlite -if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4 -if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild +@rem Fetches (and builds if necessary) external dependencies + +@rem Assume we start inside the Python source directory +cd .. +call "%VS71COMNTOOLS%vsvars32.bat" + +@rem bzip +if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3 + +@rem Sleepycat db +if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20 +if not exist db-4.4.20\build_win32\debug\libdb44sd.lib ( + devenv db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static +) + +@rem OpenSSL +if not exist openssl-0.9.8a svn export http://svn.python.org/projects/external/openssl-0.9.8a + +@rem tcltk +if not exist tcl8.4.12 ( + if exist tcltk rd /s/q tcltk + svn export http://svn.python.org/projects/external/tcl8.4.12 + svn export http://svn.python.org/projects/external/tk8.4.12 + cd tcl8.4.12\win + nmake -f makefile.vc + nmake -f makefile.vc INSTALLDIR=..\..\tcltk install + cd ..\.. + cd tk8.4.12\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 + nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd ..\.. +) + +@rem sqlite +if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4 +if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild