Commit graph

33089 commits

Author SHA1 Message Date
Tim Peters
2ad8c56e6c struct_pack(): Repair new assert-fail crash in
debug-build test_struct on a box where plain "char"
is signed.
2006-02-16 20:19:46 +00:00
Thomas Wouters
02cbdd3461 Use proper PyArg_Parse format char for Py_ssize_t, instead of 'l', in
buffer_new(). Probably fixes a bug in 'buffer("", 10, 10)' on platforms
where sizeof(Py_ssize_t) != sizeof(long) (Win64?)
2006-02-16 19:44:46 +00:00
Thomas Wouters
de01774dae Use correct PyArg_Parse format char for Py_ssize_t in unicode.center().
Fixes:

>>> u"".center(10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError

on 64-bit systems.
2006-02-16 19:34:37 +00:00
Thomas Wouters
13870b18f2 Also make _heapq.nlargest() use Py_ssize_t instead of ints, to iter over
lists and call Py_ssize_t-using helpers. All other code in this module was
already adapted to Py_ssize_t.
2006-02-16 19:21:53 +00:00
Thomas Wouters
ed6254acf2 Use 'n' format for Py_ssize_t variables to PyArg_ParseTuple(). Py_ssize_t
has been applied fairly arbitrarily in this module (nsmallest uses
Py_ssize_t, nlargest does not) and it probably deserves a more complete
review. Fixes heapq.nsmallest() always returning the empty list (on
platforms with 64-bit ssize_t/long)
2006-02-16 17:32:54 +00:00
Thomas Wouters
7a2f83b706 Use correct format specifier for Py_ssize_t variable to PyArg_ParseTuple(). 2006-02-16 17:07:41 +00:00
Thomas Wouters
977485d888 Use Py_ssize_t in helper function between Py_ssize_t-using functions. 2006-02-16 15:59:12 +00:00
Thomas Wouters
f4de69e34d Add encoding-test datafiles to svn:ignore:
EUC-CN.TXT
CP936.TXT
BIG5HKSCS.TXT
CP932.TXT
EUC-JP.TXT
SHIFTJIS.TXT
EUC-JISX0213.TXT
SHIFT_JISX0213.TXT
CP949.TXT
EUC-KR.TXT
JOHAB.TXT
BIG5.TXT
CP950.TXT
NormalizationTest-3.2.0.txt
2006-02-16 15:41:34 +00:00
Martin v. Löwis
345d6c6e8c Drop vsextcomp_verbose 2006-02-16 14:57:52 +00:00
Thomas Wouters
bbdf6078f6 Fix broken example of csv.reader use (it returns an iterator, which isn't
indexable) by using the same 'for' construct as all other examples. (Also
emphasizes that reading from a random iterable is no different than reading
from a file.)
2006-02-16 14:57:05 +00:00
Martin v. Löwis
41290685f9 Change _PyObject_GC_Resize to expect Py_ssize_t. 2006-02-16 14:56:14 +00:00
Martin v. Löwis
df40ce3646 Fix typo 2006-02-16 14:38:30 +00:00
Martin v. Löwis
67baee6287 Move cast to suppress warning. 2006-02-16 14:37:48 +00:00
Martin v. Löwis
d96ee90993 Use Py_ssize_t to count the 2006-02-16 14:37:16 +00:00
Martin v. Löwis
f5adf1eb72 Use Py_ssize_t to count the length. 2006-02-16 14:35:38 +00:00
Martin v. Löwis
eb079f1c25 Use Py_ssize_t for counts and sizes.
Convert Py_ssize_t using PyInt_FromSsize_t
2006-02-16 14:32:27 +00:00
Martin v. Löwis
ad0a4629be Use Py_ssize_t for counts and sizes. 2006-02-16 14:30:23 +00:00
Martin v. Löwis
97c65a8068 Use Py_ssize_t for field sizes and offsets. 2006-02-16 14:24:38 +00:00
Martin v. Löwis
44e379d573 Allow for ssize_t field offsets. 2006-02-16 14:23:19 +00:00
Neal Norwitz
3eaf2b5044 Update comment and make accurate. 2006-02-16 08:08:54 +00:00
Neal Norwitz
82c5a86d7c Oops, this is supposed to be disabled by default. 2006-02-16 07:30:11 +00:00
Martin v. Löwis
720ddb625b Use PyString_FromFormat for formatting error messages. 2006-02-16 07:11:33 +00:00
Martin v. Löwis
e0e89f7920 Revert 42400. 2006-02-16 06:59:22 +00:00
Martin v. Löwis
2c95cc6d72 Support %zd in PyErr_Format and PyString_FromFormat. 2006-02-16 06:54:25 +00:00
Neal Norwitz
26efe402c2 Get rid of compiler warnings (gcc 3.3.4 on x86) 2006-02-16 06:21:57 +00:00
Tim Peters
15231548d2 doubletounicode(), longtounicode():
Py_SAFE_DOWNCAST can evaluate its first argument multiple
times in a debug build.  This caused two distinct assert-
failures in test_unicode run under a debug build.  Rewrote
the code in trivial ways so that multiple evaluation of the
first argument doesn't hurt.
2006-02-16 01:08:01 +00:00
Tim Peters
c7f6cf6247 getpythonregpath(): Squash compiler warning about
mixing signed and unsigned types in comparison.
Relatedly, `dataSize` is declared as DWORD, not as
int, so change relevant cast from (int) to (DWORD).
2006-02-16 00:35:06 +00:00
Thomas Wouters
4701af5bf5 Remove two unused Py_ssize_t variables (merge glitches, looks like.) 2006-02-15 23:10:32 +00:00
Thomas Wouters
b1410fb433 Avoid unused variables when SIZEOF_SIZE_T == SIZEOF_LONG. Also normalize
whitespace.
2006-02-15 23:08:56 +00:00
Vinay Sajip
55aafab04f Added some more versionchanged markup. 2006-02-15 21:47:32 +00:00
Martin v. Löwis
a87c445177 Remove C99ism. 2006-02-15 19:56:18 +00:00
Martin v. Löwis
2ae3c91db2 Drop py:lastmerged. 2006-02-15 18:58:59 +00:00
Martin v. Löwis
18e165558b Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
Fred Drake
4482929734 use correct function in example 2006-02-15 06:55:57 +00:00
Neal Norwitz
79415523d6 Find test failures consistently 2006-02-15 06:07:32 +00:00
Tim Peters
219c164a47 randombits(): Stop compiler warning about mixing
signed with unsigned types in comparison.
2006-02-15 03:01:30 +00:00
Martin v. Löwis
9fb181bab3 Add _lsprof. 2006-02-14 21:25:29 +00:00
Martin v. Löwis
856bf9a4e9 Add build support for AMD64. 2006-02-14 20:42:55 +00:00
Tim Peters
cffcfed126 New test code failed to close the file. This caused
test_file to fail on Windows in reality (can't delete
a still-open file), but a new bare "except:" hid that
test_file failed on Windows, and leaving behind the
still-open TESTFN caused a cascade of bogus failures
in later tests.

So, close the file, and stop hiding failure to unlink.
2006-02-14 17:41:18 +00:00
Armin Rigo
967aa8b349 * Refcount leak. It was just a reference to Py_None, but still.
* Allow the 3rd argument to generator.throw() to be None.
  The 'raise' statement does the same, and anyway it follows the
  general policy that optional arguments of built-ins should, when
  reasonable, have a default value specifiable from Python.
2006-02-14 15:50:44 +00:00
Neal Norwitz
88b78d8cd4 Support 2.4 (released versions) better. (rsync was not working with adding the *. Only some files/dirs were copied, not everything.) 2006-02-14 08:14:16 +00:00
Neal Norwitz
c16dd48ee1 Doc some user visible changes 2006-02-13 02:04:37 +00:00
Neal Norwitz
389cea8efc Try to improve name based on discussion on python-checkins with Jim Jewett 2006-02-13 00:35:21 +00:00
Thomas Wouters
c45251a485 SF patch #1397960: When mixing file-iteration and
readline/readlines/read/readinto, loudly break by raising ValueError, rather
than silently deliver data out of order or hitting EOF prematurely.

Probably not a bugfix candidate, even though it affects no 'working' code.
2006-02-12 11:53:32 +00:00
Armin Rigo
f5b3e36493 Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
2006-02-11 21:32:43 +00:00
Tim Peters
cbcdfdc112 Whitespace normalization. 2006-02-11 18:32:21 +00:00
Georg Brandl
8ed1ca8fe1 Even more copyright year locations! 2006-02-11 18:22:59 +00:00
Martin v. Löwis
a55e55e9f3 Patch #428494: Prefer linking against ncursesw over ncurses library 2006-02-11 15:55:14 +00:00
Georg Brandl
b69406dc09 Update general copyright years to 2006. 2006-02-11 15:30:36 +00:00
Martin v. Löwis
f84d1b9375 Introduce Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE.
Proposed by Tim Peters.
2006-02-11 09:27:05 +00:00