Commit Graph

3835 Commits

Author SHA1 Message Date
Thomas Wouters 49fd7fa443 Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html

Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:

test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec

This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.
2006-04-21 10:40:58 +00:00
Thomas Wouters 9ada3d6e29 Merge trunk up to 43069, putting re.py back and hopefully making the branch
usable again.
2006-04-21 09:47:09 +00:00
Thomas Wouters a977329b6f Merge part of the trunk changes into the p3yk branch. This merges from 43030
(branch-creation time) up to 43067. 43068 and 43069 contain a little
swapping action between re.py and sre.py, and this mightily confuses svn
merge, so later changes are going in separately.

This merge should break no additional tests.

The last-merged revision is going in a 'last_merge' property on '.' (the
branch directory.) Arbitrarily chosen, really; if there's a BCP for this, I
couldn't find it, but we can easily change it afterwards ;)
2006-04-21 09:43:23 +00:00
Neal Norwitz bcc0db82dc Get rid of remnants of integer division 2006-03-24 08:14:36 +00:00
Neal Norwitz 227b5339ed Finish getting rid of statichere/staticforward 2006-03-22 09:28:35 +00:00
Neal Norwitz 57c179c5b9 Remove staticforward and statichere 2006-03-22 07:18:02 +00:00
Neal Norwitz a10f52e3b2 Remove PyArg_NoArgs() and PyArg_GetInt() 2006-03-17 09:00:00 +00:00
Neal Norwitz 7096760b25 Get rid of xreadlines() (methods). 2006-03-17 08:29:44 +00:00
Guido van Rossum 45aecf451a Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done)
- int/int -> float
- all exceptions must derive from BaseException
- absolute import
- 'as' and 'with' are keywords
2006-03-15 04:58:47 +00:00
Thomas Heller 915d7773e2 Try to avoid many of the compiler warnings when compiling libffi by
using a proper function prototype.
2006-03-14 20:52:24 +00:00
Thomas Heller ab906a562b Cast an Py_ssize_t to int, to avoid a compiler warning. 2006-03-14 20:39:27 +00:00
Thomas Heller fe8f862cda Integrate patch from Neal Norwitz. He writes:
"""
The attached patch fixes all the ctypes tests so they pass on amd64.
It also fixes several warnings.  I'm not sure what else to do with the
patch.  Let me know how you want to handle these in the future.

I'm not sure the patch is 100% correct.  You will need to decide what
can be 64 bits and what can't.  I believe
sq_{item,slice,ass_item,ass_slice} all need to use Py_ssize_t.  The
types in ctypes.h may not require all the changes I made.  I don't
know how you want to support older version, so I unconditionally
changed the types to Py_ssize_t.
"""

The patch is also in the ctypes SVN repository now, after small
changes to add compatibility with older Python versions.
2006-03-14 19:53:09 +00:00
Neal Norwitz 7580146b5c Fix and test (manually w/xx module) passing NULLs to PyObject_Str() and
PyObject_Unicode().  This problem was originally reported from Coverity
and addresses mail on python-dev "checkin r43015".

This inlines the conversion of the string to unicode and cleans
up/simplifies some code at the end of the PyObject_Unicode().

We really need a complete C API test module for all public APIs
and passing good and bad parameter values.

Will backport.
2006-03-14 06:02:16 +00:00
Hye-Shik Chang abb903fd54 Bug #1448490: Fix a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
2006-03-13 10:20:08 +00:00
Fredrik Lundh 44ed4db955 merged with cElementTree development trunk (1.0.6 snapshot):
Fixed a number of potential null-pointer-reference-under-pressure
glitches, based on input from the Coverity analysis tool and Simo
Salminen.
2006-03-12 21:06:35 +00:00
Thomas Wouters b2820ae355 Fix another leak in bsddb, and avoid use of uninitialized value -- funny how
gcc 4.0.x wasn't complaining about *that* one ;)
2006-03-12 00:01:38 +00:00
Martin v. Löwis c350912990 Adjust CJK Ideograph range to Unicode 4.1. 2006-03-11 12:16:23 +00:00
Martin v. Löwis 0e2f9b2dfb Fix refcounting bug. 2006-03-10 11:29:32 +00:00
Martin v. Löwis 5bd7c02298 Avoid forward-declaring the methods array.
Rename unicodedata.db* to unicodedata.ucd*
2006-03-10 11:20:04 +00:00
Guido van Rossum f669436189 Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
2006-03-10 02:28:35 +00:00
Martin v. Löwis 480f1bb67b Update Unicode database to Unicode 4.1. 2006-03-09 23:38:20 +00:00
Neal Norwitz 72c2c062d7 Try to be a bit more consistent on all platforms:
python .
  python < .

both print a message, return non-zero and do not core dump.
2006-03-09 05:58:11 +00:00
Thomas Heller d4c9320412 Copy ctypes-0.9.9.4 sources from external into the trunk. 2006-03-08 19:35:11 +00:00
Georg Brandl f3c4ad1410 typo 2006-03-08 12:24:33 +00:00
Neal Norwitz 2f5e9903a0 Fix logic error and DECREF reported by Coverity. 2006-03-08 06:36:45 +00:00
Thomas Wouters b3153832c2 Clean up _bsddb.c: add a couple dozen missing Py_DECREF()'s, a handful of
missing PyObject_Del()'s, simplify some code by using Py_BuildValue()
instead of creating a tuple with items manually, stop clobbering builtin
exceptions in a few places, and guard against NULL-returning functions some
more.

This fixes 117 of the 780 (!?!#%@#$!!) reference leaks in test_bsddb3. I
ain't not done yet, although this review of 5kloc was just the easy part.
2006-03-08 01:47:19 +00:00
Martin v. Löwis e920f0d340 Reformulate 42903 using an if statement. 2006-03-07 23:59:33 +00:00
Tim Peters df44ab7b1c _hotshot hotshot_profiler(): If write_header() returned
an error code, this let `self` leak.  This is a disaster
on Windows, since `self` already points to a newly-opened
file object, and it was impossible for Python code to
close the thing since the only reference to it was in a
blob of leaked C memory.

test_hotshot test_bad_sys_path():  This new test provoked
the C bug above.  This test passed, but left an open
"@test" file behind, which caused a massive cascade of
bogus test failures in later, unrelated tests on Windows.
Changed the test code to remove the @test file it leaves
behind, which relies on the change above to close that
file first.
2006-03-07 23:53:32 +00:00
Georg Brandl 516999e6e2 Fix bug introduced in rev. 42884. 2006-03-07 20:56:02 +00:00
Guido van Rossum 38fff8c4e4 Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
2006-03-07 18:50:55 +00:00
Hye-Shik Chang 4af5c8cee4 SF #1444030: Fix several potential defects found by Coverity.
(reviewed by Neal Norwitz)
2006-03-07 15:39:21 +00:00
Georg Brandl ef1701f7d3 Add additional missing checks for return vals of PyTuple_New().
Normalize coding style.
2006-03-07 14:57:48 +00:00
Thomas Wouters 89ba38152d Fix gcc 4.0.x warning about use of uninitialized value. 2006-03-07 14:14:51 +00:00
Thomas Wouters 098f6943c0 Coverity found bug: test result of PyTuple_New() against NULL before use.
Will backport.
2006-03-07 14:13:17 +00:00
Thomas Wouters a74a84d4cb Coverity found refleak: need to free 'v' after calling Tkinter_Error().
Will backport to release24.
2006-03-07 14:04:31 +00:00
Thomas Wouters 47f003d326 Coverity-found bug: don't use temp->next *before* checking it for NULL. Also
return rather than use it again.
2006-03-07 13:38:14 +00:00
Georg Brandl 622927b850 Bug #1432525: os.listdir now releases the GIL while calling
readdir().
2006-03-07 12:48:03 +00:00
Martin v. Löwis 725507b52e Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
2006-03-07 12:08:51 +00:00
Thomas Wouters 8eb8a829c1 Don't DECREF a borrowed reference. 2006-03-07 11:58:50 +00:00
Barry Warsaw d3c38ff7f8 SF patch #1443865; gc.get_count() added and optional argument 'generation'
added to gc.collect().  Updated docs, unit test, and NEWS entry.

(Also, fixed a typo in NEWS.)
2006-03-07 09:46:03 +00:00
Neal Norwitz 60da31660c Thanks to Coverity, these were all reported by their Prevent tool.
All of these (except _lsprof.c) should be backported.  Particularly
the hotshot change which validates sys.path.  Can someone backport?
2006-03-07 04:48:24 +00:00
Neal Norwitz e22373d690 Fix warnings on x86 (32-bit) and support Win64. 2006-03-06 23:31:56 +00:00
Hye-Shik Chang 32feb8592f Check NULL if Py_InitModule fails. 2006-03-06 07:51:19 +00:00
Neal Norwitz 7b216c52e4 Make PyGC_Collect() use Py_ssize_t. 2006-03-04 20:01:53 +00:00
Hye-Shik Chang 4b96c1384e - Modernize code to use Py_ssize_t more intensively.
- Do some minor code clean-ups.
2006-03-04 16:08:19 +00:00
Thomas Wouters 857b300b2e Explain why we use the unsigned int format for a signed int variable.
(Should 'code' be cast to the right pointer type?)
2006-03-02 17:58:27 +00:00
Thomas Wouters 83d1266cbd Properly fix Py_SAFE_DOWNCAST-triggerd bugs. 2006-03-02 05:05:17 +00:00
Thomas Wouters 369092be43 Py_SAFE_DOWNCAST isn't quite doing the right thing for going from Py_ssize_t
to an unsigned int (and back again) on 64-bit machines, even though the
actual value of the Py_ssize_t variable is way below 31 bits. I suspect
compiler-error.
2006-03-02 04:48:27 +00:00
Thomas Wouters 26cc63f867 Make Py_ssize_t-clean 2006-03-02 00:21:10 +00:00
Martin v. Löwis 5df2e614e6 Remove UNLESS. 2006-03-01 23:10:49 +00:00