Neal Norwitz [Sat, 9 Jun 2007 04:06:30 +0000 (04:06 +0000)]
Prevent expandtabs() on string and unicode objects from causing a segfault when
a large width is passed on 32-bit platforms. Found by Google.
It would be good for people to review this especially carefully and verify
I don't have an off by one error and there is no other way to cause overflow.
Hye-Shik Chang [Tue, 5 Jun 2007 19:14:33 +0000 (19:14 +0000)]
(Backport from r55770)
Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it
reads a file that ends with incomplete sequence and sizehint argument
for .read() is specified.
Neal Norwitz [Sun, 20 May 2007 02:14:48 +0000 (02:14 +0000)]
Backout the original 'fix' to 1721309 which had no effect.
Different versions of Berkeley DB handle this differently.
The comments and bug report should have the details. Memory is allocated
in 4.4 (and presumably earlier), but not in 4.5. Thus
4.5 has the free error, but not earlier versions.
Mostly update comments, plus make the free conditional.
Georg Brandl [Tue, 15 May 2007 20:19:39 +0000 (20:19 +0000)]
HTML-escape the plain traceback in cgitb's HTML output, to prevent
the traceback inadvertently or maliciously closing the comment and
injecting HTML into the error page.
(backport from rev. 55348)
Merge change 54983 from the trunk: Add the locale "English" to test_locale.py for a windows run, since "En" isn't legal for the Visual C 8 runtime. This update restores full testsuite compliance to VisualStudio 2005 builds, apart from unavailible external modules.
Merge change 54982 from the trunk. This fixes the test_subprocess test in the testsuite for VisualStudio2005 builds, by "sanitizing" the "mode" that is used in the posixmodule's fdopen(). In particular the non-standard "U" mode character is removed.
the nb_long slot on classobject instances now defaults to call the nb_int slot member if there is no __long__ attribute found. This is in accordance with a suggestion from Armin Rigo, and allows the test_getargs2.py test in the testsuite for x64
Fix two problems that emerged when the testsuite was run with an x64 build: PyLong_FromSSize_t incorrectly assumed an unsigned object, and itertools.count() had the wrong upper limit for the iterator.
Fix NonRecursiveMutex on x64. The signature of the faux-InterlockedCompareExchange function was wrong: It works with LONG and not PVOID objects, and it needs to have the target marked as volatile. Further, it is not needed at all for x64 targets, since that platform always has the real McCoy.
Merging change 55102 from the trunk:
Fix those parts in the testsuite that assumed that sys.maxint would cause overflow on x64. Now the testsuite is well behaved on that platform.
When accessing the .value attribute of a c_wchar_p instance, and the
instance does not point to a valid wchar_t zero-terminated string,
raise a ValueError. c_char_p does this already.
The ValueError message now contains the correct pointer address.
Additional changes to the property sheets in PCBuild8. Visual Studio doesn's save those when it builds, unlike the .vcproj files, so I chekced in out-of-date versions.
Merging of change 55024 from the truk to release25-maint branch.
Complete revamp of PCBuild8 directory. Use subdirectories for each project under the main pcbuild solution. Now make extensive use of property sheets to simplify project configuration. x64 build fully supported, and the process for building PGO version (Profiler Guided Optimization) simplified. All projects are now present, except _ssl, which needs to be reimplemented. Also, some of the projects that require external libraries need extra work to fully compile on x64.
Update with the version that has been running for a while. Most of
the changes are to support multiple versions (ie, trunk and 2.5).
Also check for conflicts in the .tex file when a release is cut.
Georg Brandl [Tue, 24 Apr 2007 15:27:25 +0000 (15:27 +0000)]
Bug #1706381: Specifying the SWIG option "-c++" in the setup.py file
(as opposed to the command line) will now write file names ending in
".cpp" too.
(backport from rev. 54941)
Barry Warsaw [Mon, 23 Apr 2007 01:58:33 +0000 (01:58 +0000)]
Recommit r54805:
Add code to read from master_fd in the parent, breaking when we get an OSError
(EIO can occur on Linux) or there's no more data to read. Without this,
test_pty.py can hang on the waitpid() because the child is blocking on the
stdout write. This will definitely happen on Mac OS X and could potentially
happen on other platforms. See the comment for details.
Fix various minor issues discovered with static analysis using Visual Studio 2005 Team System.
Removed obsolete comment, since .dll modules are no longer supported on windows, only .pyd.
Lars Gustäbel [Sat, 21 Apr 2007 12:20:09 +0000 (12:20 +0000)]
Bug #1704156: Support for unicode strings as input filenames is
neither documented nor intended but works in Python 2.4 under certain
conditions. This stopped working in 2.5 because struct.pack is used.
This small patch restores the old behaviour. A more solid solution is
planned for 2.6.
Walter Dörwald [Sat, 21 Apr 2007 10:31:43 +0000 (10:31 +0000)]
Backport r54786:
Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.