Andrew McNamara
91b97463cd
Factor out the code for making a dialect instance.
2005-01-11 01:07:23 +00:00
Andrew McNamara
dbce2618b1
Only set error string when dict lookup found no matching key (was setting
...
it for all failures, potentially masking other exceptions).
2005-01-10 23:17:35 +00:00
Andrew McNamara
a8292636c6
When parsing args that return a single character, treat null string the
...
same as None.
2005-01-10 12:25:11 +00:00
Andrew McNamara
37d2bdfa76
Where a string is desired, test for PyBaseString_Type derived type,
...
rather than using PyString_Check/PyUnicode_Check.
2005-01-10 12:22:48 +00:00
Andrew McNamara
77ead87f30
Add missing PyObject_GC_Track and PyObject_GC_UnTrack calls to csv reader and
...
writer objects (other GC infrastructure already in place).
2005-01-10 02:09:41 +00:00
Andrew McNamara
36a7691c2d
Fix parsing of csv files with escapes (escape character previously would be
...
left in stream).
2005-01-10 01:04:40 +00:00
Andrew McNamara
dd3e6cb213
Fix to use PEP7 brace style.
2005-01-07 06:46:50 +00:00
Andrew McNamara
1196cf185c
Improved the implementation of the internal "dialect" type. The new
...
implementation features better error reporting, and better compliance
with the PEP.
2005-01-07 04:42:45 +00:00
Andrew McNamara
575a00b575
Delete Reader_getiter and replace with PyObject_SelfIter.
2005-01-06 02:25:41 +00:00
Andrew M. Kuchling
3b585b30c0
[Bug #1083110 ] calling .flush() on decompress objects causes a segfault due to an uninitialized pointer: fixes the problem and adds a test case
2004-12-28 20:10:48 +00:00
Raymond Hettinger
3a4231dd74
Bug #1087216 : datetime module documentation missing critical detail
2004-12-19 20:13:24 +00:00
Andrew MacIntyre
a3be258477
fix unterminated comment
2004-12-18 09:51:05 +00:00
Raymond Hettinger
6f5b741a46
SF bug #1086555 : refcount problem in syslog
2004-12-16 23:52:04 +00:00
Raymond Hettinger
b0900e6a21
SF #1085304 : Make array.array pickle-able
2004-12-16 16:23:40 +00:00
Gregory P. Smith
8a6a59c58b
fixed compilation against BerkeleyDB 3.2.9 (sf bug # 1077040)
2004-12-16 09:47:28 +00:00
Gregory P. Smith
8b7e917ab2
* Adds support for building against BerkeleyDB 4.3.21
...
* bumped the module version number up to 4.3.0
2004-12-13 09:51:23 +00:00
Andrew MacIntyre
a4a8afb4e1
OS/2 specific fixes related to SF bug # 1003471.
...
Also revise a related function to minimise file handle/pipe leakage
and improve reliability.
2004-12-12 08:30:51 +00:00
Raymond Hettinger
a6b45cc31d
Eliminate the deprecated option to return None instead of a tuple of arguments in __reduce__().
2004-12-07 07:05:57 +00:00
Raymond Hettinger
b2594050ea
Added optional None arguments to itertools.islice().
2004-12-05 09:25:51 +00:00
Gustavo Niemeyer
166878f544
Fixing bug #1072259 in SRE.
2004-12-02 16:15:39 +00:00
Michael W. Hudson
02d74f68c6
Hear the #error: change the default value of the mutable_arg argument
...
to ioctl() and remove the warning when it is not supplied.
2004-11-30 14:31:54 +00:00
Hye-Shik Chang
7a8173a477
Rename a static variable "history_length" to "_history_length".
...
GNU readline exports a global variable that has such a name already
and the collision makes gcc4 doesn't compile the source.
2004-11-25 04:04:20 +00:00
Marc-André Lemburg
a9cadcd41b
Correct the handling of 0-termination of PyUnicode_AsWideChar()
...
and its usage in PyLocale_strcoll().
Clarify the documentation on this.
Thanks to Andreas Degert for pointing this out.
2004-11-22 13:02:31 +00:00
Martin v. Löwis
fba7369824
Patch #1050475 : Fix various x86_64 build issues
...
regrtest.py: skip rgbimg and imageop as they are not built on 64-bit systems.
_tkinter.c: replace %.8x with %p for printing pointers.
setup.py: add lib64 into the library directories.
2004-11-13 11:13:35 +00:00
Raymond Hettinger
2c45c9ae57
SF patch 1062495: Modules/zipimport.c does not compile on solaris
...
(Contributed by Niki W. Waibel.)
Simple renaming to avoid a conflict that prevented compilation on Solaris.
2004-11-10 13:08:35 +00:00
Raymond Hettinger
952f8808b2
SF patch #1062279 : deque pickling problems
...
(Contributed by Dima Dorfman.)
* Support pickling of dictionaries in instances of deque subclasses.
* Support pickling of recursive deques.
2004-11-09 07:27:35 +00:00
Jeremy Hylton
80961f3ca9
Fix apparently trivial buffer overflow (SF bug 1060396).
...
memset() wrote one past the end of the buffer, which was likely to be unused padding or a yet-to-be-initialized local variable. This routine is already tested by test_socket.
2004-11-07 14:24:25 +00:00
Raymond Hettinger
7d112df94f
Bump-up block size.
2004-11-02 02:11:35 +00:00
Walter Dörwald
bb9c739806
Add error checks for the bz2, cStringIO and operator modules.
...
Add function names to various PyArg_ParseTuple calls in bz2module.c.
2004-11-01 17:10:19 +00:00
Tim Peters
bc1d1b80d1
gc_list_move(): Make this truly equivalent to remove+append. While
...
nothing in gc currently cares, the original coding could screw up if,
e.g., you tried to move a node to the list it's already in, and the node
was already the last in its list.
2004-11-01 16:39:57 +00:00
Tim Peters
e2d591847c
gc list function cleanup.
...
Introduced gc_list_move(), which captures the common gc_list_remove() +
gc_list_append() sequence. In fact, no uses of gc_list_append() remained
(they were all in a gc_list_move() sequence), so commented that one out.
gc_list_merge(): assert that `from` != `to`; that was an implicit
precondition, now verified in a debug build.
Others: added comments about their purpose.
2004-11-01 01:39:08 +00:00
Tim Peters
cc2a866cb7
handle_weakrefs(): Simplification -- there's no need to make a second
...
pass over the unreachable weakrefs-with-callbacks to unreachable objects.
2004-10-31 22:12:43 +00:00
Tim Peters
ead8b7ab30
SF 1055820: weakref callback vs gc vs threads
...
In cyclic gc, clear weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.
This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced. I'll backport to 2.3.
2004-10-30 23:09:22 +00:00
Fred Drake
08ebfec75e
some platforms still need offsetof() from structmember.h
2004-10-17 19:36:57 +00:00
Raymond Hettinger
a9f6092904
Fix and test weak referencing of itertools.tee objects.
2004-10-17 16:40:14 +00:00
Michael W. Hudson
3079391b8d
Just remove the #include of signal.h. That it was C++-commented out
...
was a mistake of mine in updating patch #975056 (I think).
2004-10-14 13:27:14 +00:00
Neal Norwitz
f7c8d9320b
Use C89 style comment for old compilers
2004-10-14 03:48:30 +00:00
Martin v. Löwis
9171f02132
Synchronize with PyXML 1.79:
...
73: Restore support for Python 2.1.
74: Factor the previous change differently
79: Conditionalize usage of PyTuple_Pack.
2004-10-13 19:50:11 +00:00
Anthony Baxter
8a560dee72
Patch 977343, Solaris likes sys/loadavg.h. Added support for sys/loadavg.h
...
detection to configure &c.
2004-10-13 15:30:56 +00:00
Anthony Baxter
9ceaa72ebe
Patch #975056 - fixes for restartable signals on *BSD. In addition,
...
a few remaining calls to signal() were converted to PyOS_setsig().
2004-10-13 14:48:50 +00:00
Raymond Hettinger
dcb9d9467c
Simplify delitem() code by calling rotate() directly instead of using
...
arguments passed through tuples.
2004-10-09 16:02:18 +00:00
Michael W. Hudson
8da2b01c3f
This is Michiel de Hoon's patch, as attached to the bug report:
...
[ 1030629 ] PyOS_InputHook broken
with a couple of utterly inconsequential changes by me.
2004-10-07 13:46:33 +00:00
Raymond Hettinger
db29e0fe8c
SF patch #1035498 : -m option to run a module as a script
...
(Contributed by Nick Coghlan.)
2004-10-07 06:46:25 +00:00
Raymond Hettinger
c5fa992069
Armin's patch to prevent overflows.
2004-10-06 17:51:54 +00:00
Armin Rigo
974d757af1
Upon insertion, if memory runs out, the deque was left in a corrupted state.
...
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".
deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.
deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before). Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...
deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed. Added a test.
I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c. On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble. (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
2004-10-02 13:59:34 +00:00
Raymond Hettinger
880430e2a5
Replace structure member before decreffing.
2004-10-02 10:56:43 +00:00
Raymond Hettinger
d1b3d88bf3
* Bulletproof the method for detecting mutations during iteration.
...
The previous approach was too easily fooled (a rotate() sufficed).
* Use it->counter to determine when iteration is complete. The
previous approach was too complex.
* Strengthen an assertion and add a comment here or there.
2004-10-02 00:43:13 +00:00
Raymond Hettinger
77e8bf1ca4
Restore the block length and add a comment.
2004-10-01 15:25:53 +00:00
Raymond Hettinger
4ca4c7c8cc
Clarify the relationship between indices.
2004-10-01 15:14:39 +00:00
Raymond Hettinger
61f05fb96d
* Elaborate on the invariant comments and make them more precise.
...
* Change the centering by one to make it possible to test the module
with BLOCKLEN's as low as two. Testing small blocks makes end-point
errors surface more readily.
2004-10-01 06:24:12 +00:00
Tim Peters
10c7e86454
deque_traverse(): If the deque had one block, and its rightindex was
...
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build. Reported on c.l.py by Stefan Behnel.
2004-10-01 02:01:04 +00:00
Tim Peters
d6e0032768
Typos in new comments.
2004-10-01 01:35:54 +00:00
Tim Peters
d8768d3294
Document some reverse-engineered invariants and pragmatic hints.
2004-10-01 01:32:53 +00:00
Tim Peters
6f85356ff7
Definition consistency.
2004-10-01 01:04:50 +00:00
Tim Peters
1065f750cb
Trimmed trailing whitespace.
2004-10-01 01:03:29 +00:00
Raymond Hettinger
4cda01e260
* Increase test coverage.
...
* Have groupby() be careful about decreffing structure members.
2004-09-28 04:45:28 +00:00
Raymond Hettinger
87de0ca741
Silence a compiler warning by supplying the correct argument type to
...
the htons() function.
2004-09-28 02:19:40 +00:00
Raymond Hettinger
855d9a985b
Plug a leak and beef-up test coverage.
2004-09-28 00:03:54 +00:00
Armin Rigo
b6aa856f25
Patch #1009075 , bug #952953 : allow execve with empty 2nd argument
2004-09-27 19:54:33 +00:00
Armin Rigo
9f90439817
Patch #1011240 : SystemError generated by struct.pack('P', 'foo').
2004-09-27 19:27:51 +00:00
Raymond Hettinger
9447874131
Add docstrings for regular expression objects and methods.
2004-09-24 04:31:19 +00:00
Tim Peters
528ca53b74
SF bug #1028306 : date-datetime comparison
...
Treat comparing a date to a datetime like a mixed-type comparison.
2004-09-16 01:30:50 +00:00
Trent Mick
8ea5bdf784
Patch for compilation on IRIX from rwgk on http://python.org/sf/728330
2004-09-13 17:48:41 +00:00
Walter Dörwald
69652035bc
SF patch #998993 : The UTF-8 and the UTF-16 stateful decoders now support
...
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.
2004-09-07 20:24:22 +00:00
Trent Mick
a708d6e3b0
Apply patch from http://python.org/sf/728330 to fix socket module compilation on Solaris 2.6, HP-UX 11, AIX 5.1 and (possibly) some IRIX versions.
2004-09-07 17:48:26 +00:00
Raymond Hettinger
9fd5e9a695
Remove redunandant assertions from last checkin.
2004-09-06 23:02:37 +00:00
Raymond Hettinger
658717ed11
SF #1022953 : binascii.a2b_hqx("") raises SystemError
...
Several functions adopted the strategy of altering a full lengthed
string copy and resizing afterwards. That would fail if the initial
string was short enough (0 or 1) to be interned. Interning precluded
the subsequent resizing operation.
The solution was to make sure the initial string was at least two
characters long.
Added tests to verify that all binascii functions do not crater when
given an empty string argument.
2004-09-06 22:58:37 +00:00
Raymond Hettinger
8158e84930
Fix erroneous docstring comment.
2004-09-06 07:04:09 +00:00
Gregory P. Smith
442c9fc376
SF bug 1017405: the keys() values() and items() DB methods were
...
ignoring their transaction (txn) argument.
2004-09-04 01:36:59 +00:00
Gustavo Niemeyer
0506c64086
Fixing bug #817234 , which made SRE get into an infinite loop on
...
empty final matches with finditer(). New test cases included
for this bug and for #581080 .
2004-09-03 18:11:59 +00:00
Raymond Hettinger
75ccea3777
SF patch #1020188 : Use Py_CLEAR where necessary to avoid crashes
...
(Contributed by Dima Dorfman)
2004-09-01 07:02:44 +00:00
Andrew M. Kuchling
4e699d5f95
Remove mpz, rotor, xreadlines modules
2004-08-31 13:50:12 +00:00
Andrew M. Kuchling
57269d0c7c
Remove mpz, rotor, xreadlines modules
2004-08-31 13:37:25 +00:00
Anthony Baxter
1a4ddaecc7
SF patch #1007189 , multi-line imports, for instance:
...
"from blah import (foo, bar
baz, bongo)"
2004-08-31 10:07:13 +00:00
Tim Peters
d311538a93
win32_urandom(): There's no need to copy the generated byte string, so
...
don't.
2004-08-30 17:36:46 +00:00
Tim Peters
9b279a8df4
win32_urandom(): pass the function name to PyArg_ParseTuple, for better
...
error msgs.
2004-08-30 17:10:53 +00:00
Tim Peters
51eba6115d
win32_urandom(): Raise ValueError if the argument is negative.
2004-08-30 17:08:02 +00:00
Tim Peters
4ad8217ae9
win32_urandom(): Rewrite to Python C standards (hard tabs, function name
...
in first column, no parens around return value).
2004-08-30 17:02:04 +00:00
Martin v. Löwis
dc3883f671
Patch #934711 : Expose platform-specific entropy.
2004-08-29 15:46:35 +00:00
Raymond Hettinger
6ab78cd0c0
SF feature request #992967 : array.array objects should support sequences.
...
Made the constructor accept general iterables.
2004-08-29 07:50:43 +00:00
Brett Cannon
269ab628d7
Fix the spelling of Fredrik Lundh's last name (unless there really is a
...
"Fredrik Lund" who contributed the code in question).
2004-08-27 05:00:22 +00:00
Dave Cole
e8bbfe4e63
Patch #1015012 . Improve markup and punctuation in libsocket.tex
2004-08-26 00:51:16 +00:00
Dave Cole
3203efb55f
Patch #1014930 . Expose current parse location to XMLParser.
2004-08-26 00:37:31 +00:00
Martin v. Löwis
b92b7ed9d6
Back out 1.289, which breaks platforms needing addrinfo.h, and
...
1.293, 1.298, and 1.300, which have tried to fix this for specific
platforms.
2004-08-25 06:24:58 +00:00
Neal Norwitz
1fa040ba73
SF #1015517 , get readline to compile with older compilers
2004-08-25 01:20:18 +00:00
Mark Hammond
eb619bb80b
Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),
...
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
2004-08-24 22:24:08 +00:00
Dave Cole
07fda7e3a0
Updated the socketpair() docstring and documentation to explain that the
...
default famility is AF_UNIX if defined for the platform, otherwise the
default is AF_INET.
2004-08-23 05:16:23 +00:00
Dave Cole
0fc8575412
Removed unnecessary calls to signal() to ignore SIGPIPE. SIGPIPE is ignored
...
in initsigs() inside pythonrun.c.
2004-08-23 04:54:53 +00:00
Tim Peters
037b3ee44e
Patch 1012740: cStringIO's truncate doesn't
...
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:
>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'
Patch by Dima Dorfman.
2004-08-21 06:55:43 +00:00
Martin v. Löwis
701abe745b
Fail fatally if strdup fails.
2004-08-20 06:26:59 +00:00
Hye-Shik Chang
f5a149a6b6
Bug #1005737 , #1007249 : Fix several build problems and warnings
...
found on legacy C compilers of HP-UX, IRIX and Tru64. (Reported
by roadkill, Richard Townsend, Maik Hertha and Minsik Kim)
2004-08-19 17:49:56 +00:00
Martin v. Löwis
4d4dfb7a2b
Patch #1011822 : Display errno/strerror for inaccessible files.
2004-08-19 11:07:49 +00:00
Martin v. Löwis
78a8acc55b
Patch #914291 : Restore locale while readline is running.
2004-08-18 13:34:00 +00:00
Michael W. Hudson
0ccff074cd
This is Mark Russell's patch:
...
[ 1009560 ] Fix @decorator evaluation order
From the description:
Changes in this patch:
- Change Grammar/Grammar to require
newlines between adjacent decorators.
- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers
- Add better order of evaluation check
to test_decorators.py (test_eval_order)
- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)
and the comment:
Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html )
(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
2004-08-17 17:29:16 +00:00
Skip Montanaro
6c06cd5ff9
fix a couple problems with the last patch picked up by Michael Hudson
2004-08-16 16:15:13 +00:00
Skip Montanaro
e5069019e7
Add get_history_item and replace_history_item functions to the readline
...
module. Closes patch #675551 . My apologies to Michal Vitecek for taking so
long to process this.
2004-08-15 14:32:06 +00:00
Johannes Gijsbers
8d3b9dd09c
Quote \r\n correctly, remove random indentation (patch #1009384 ). Thanks
...
Cherniavsky Beni!
2004-08-15 12:23:10 +00:00
Fred Drake
39689c5c6a
make exception propogation more efficient; this avoids having Expat parse
...
the remaining data in the buffer (which it had done happily without reporting
any results)
this depends on a new feature in Expat added in 1.95.8
2004-08-13 03:12:57 +00:00
Martin v. Löwis
0cb3c63503
Patch #1005568 : Use _SC_PAGESIZE on Irix.
...
Backported to 2.3.
2004-08-12 13:26:56 +00:00
Jason Tishler
c246cb76e6
Bug #1001857 : socketmodule does not build under cygwin
...
Restore clean building under Cygwin.
2004-08-09 13:25:59 +00:00