Commit Graph

1737 Commits

Author SHA1 Message Date
Fred Drake 6f9876212d initpyexpat(): Code cleanup; makes it more robust and reduces warnings.
Added prototype to remove yet another warning.

Make a number of the handlers and helpers "static" since they are not
used in other C source files.  This also reduces the number of warnings.

Make a lot of the code "more Python".  (Need to get the style guide done!)
2000-08-25 18:03:30 +00:00
Sjoerd Mullender 239f836c10 Not every OS that support poll seems to support POLLMSG. 2000-08-25 13:59:18 +00:00
Andrew M. Kuchling cf96dc800e Add interface to poll() system call (SF patch #100852) 2000-08-25 01:15:33 +00:00
Thomas Wouters 65f39adfb3 Adjust the name for the socket module in the SSL line. 2000-08-24 22:54:53 +00:00
Fred Drake 9ed49e979f Fix the evil booboos. ;( Causes discussed with Jeremy offline. 2000-08-24 22:27:02 +00:00
Fred Drake c23b5239ae Remove the Py_FatalError() from initpyexpat(); the Guido has decreed
that this is not appropriate.

Made somewhat more robust in the face of reload() (exception is not
rebuilt, etc.).

Made the exception a class exception.
2000-08-24 21:57:43 +00:00
Fred Drake 85bf3bb44a validate_listmaker(): Revise to match Skip's latest changes to the
Grammar file.  This makes the test suite pass once again.
2000-08-23 15:35:26 +00:00
Tim Peters 72b93ec1c3 Nuked unused variable. 2000-08-22 01:44:16 +00:00
Fred Drake cff283c7b3 Update to reflect recent grammar changes (list comprehensions, extended
print statement), and fix up the extended call syntax support.

Minor stylistic cleanups.
2000-08-21 22:24:43 +00:00
Andrew M. Kuchling a98e92bc13 Add alias for old function name -- removing it broke Alexei Gilchrist's cfm 2000-08-20 23:37:02 +00:00
Andrew M. Kuchling f580d27aa3 Use METH_VARARGS constant in example module.
Fix comment typo
2000-08-19 15:36:41 +00:00
Sjoerd Mullender f28b898f13 Removed references to Py_FPROTO. 2000-08-18 10:00:28 +00:00
Barry Warsaw f087960e99 ANSI-fy function headers. Not much more can be done since I don't
have access to Purify anymore.
2000-08-18 05:13:47 +00:00
Barry Warsaw 4ddd8202bc lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already
been closed.  Don't try to reclose it.  Found by Insure.
2000-08-18 05:10:45 +00:00
Barry Warsaw 152fbe88e9 pattern_findall(): Plug small memory leak discovered by Insure.
PyList_Append() always incref's the inserted item.  Be sure to decref
it regardless of whether the append succeeds or fails.
2000-08-18 05:09:50 +00:00
Barry Warsaw fc4514c22b init_locale(): This file defines the _locale module, so the
Py_FatalError() should reflect that.
2000-08-18 05:07:12 +00:00
Trent Mick 239548f37d The sre test suite currently overruns the stack on Win64, Linux64, and Monterey
(64-bit AIX) This is because the RECURSION_LIMIT is too low. This patch lowers
to recusion limit to 7500 such that the recusion check fires before a segfault.

Fredrik suggested/approved the fix in private email, modulo sre's recusion
limit checking no being necessary when PyOS_CheckStack is implemented for
Windows.
2000-08-16 22:29:55 +00:00
Fred Drake b526e5fa99 The socket module is now _socket on all platforms. 2000-08-16 14:19:43 +00:00
Fred Drake a136d4970c Remove a lot of the confusing conditional compilation from the beginning
of the init_socket() function.  This module is now *always* _socket.
2000-08-16 14:18:30 +00:00
Fred Drake 56221a7cfa Chris Herborth <chrish@pobox.com>:
Minor updates for BeOS R5.

Use of OSError in test.test_fork1 changed to TestSkipped, with corresponding
change in BeOS/README (by Fred).

This closes SourceForge patch #100978.
2000-08-15 18:52:33 +00:00
Tim Peters b59ab42487 Fix new compiler warnings. Unused var in compile.c. Argsize mismatches
in binascii.c (only on platforms with signed chars -- although Py_CHARMASK
is documented as returning an int, it only does so on platforms with
signed chars).
2000-08-15 16:41:26 +00:00
Barry Warsaw 16168477eb binascii_unhexlify(): Better error message, courtesy effbot. 2000-08-15 06:59:58 +00:00
Barry Warsaw e977c210cb After a brief conversation and code review with TP, adding two very
commonly used functions to convert an arbitrary binary string into
a hexadecimal digit representation and back again.  These are often
(and often differently) implemented in Python.  Best to have one
common fast implementation.  Specifically,

binascii_hexlify(): a.k.a. b2a_hex() to return the hex representation
of binary data.

binascii_unhexlify(): a.k.a. a2b_hex() to do the inverse conversion
(hex digits to binary data).  The argument must have an even length,
and must contain only hex digits, otherwise a TypeError is raised.
2000-08-15 06:07:13 +00:00
Barry Warsaw 57b808d21a SHA_hexdigest(): A couple of small patches to this function, added
after a brief conversation with TP.  First, the return values of the
PyString_* function calls should be checked for errors.  Second,
bit-manipulations should be used instead of division for spliting the
byte up into its 4 bit digits.
2000-08-15 06:03:35 +00:00
Barry Warsaw 3ec0fbb299 md5_hexdigest(): After a brief conversation with TP, added hexdigest()
to this module to mirror sha's hexdigest() method.
2000-08-15 05:59:44 +00:00
Mark Hammond 33a6da9971 Fix for bug #110670 - Win32 os.listdir raises confusing errors:
The existing win32_error() function now returns the new(ish) WindowsError, ensuring we get correct error messages.
2000-08-15 00:46:38 +00:00
Mark Hammond b37a373496 Patch #101032, from David Bolen:
This is an enhancement to a prior patch (100941) ...
[T]his patch removes the risk of deadlock waiting for the child previously present in certain cases. It adds tracking of all file handles returned from an os.popen* call and only waits for the child process, returning the exit code, on the closure of the final file handle to that child.
2000-08-14 04:47:33 +00:00
Trent Mick 6c116dd56b Use safer comparisons (only matters when sizeof(int) != sizeof(size_t)). fread
and fwrite return size_t, so it is safer to cast up to the largest type for the
comparison. I believe the cast is required at all to remove compiler warnings.
2000-08-12 20:58:11 +00:00
Fred Drake 091ec2cfdd Add support for FreeBSD --rpath linker option; this is equivalent to
-R on Solaris and -rpath on IRIX.

This closes SourceForge bug #110613 (Jitterbug PR#202), reported by
<aa8vb@yahoo.com>.
2000-08-11 13:58:37 +00:00
Fred Drake 68933b94d3 Clean up compiler warning exposed by GCC's -Wall option: make sure
Python.h is included before standard headers since we set _GNU_SOURCE
there.  This ensures that strdup() is prototyped.
2000-08-10 21:41:08 +00:00
Peter Schneider-Kamp 10e1bf2f64 remove all occurence of math.rint() from the sources
(and yes, "Currintly" also counts <0.5 wink>)
2000-08-10 04:23:30 +00:00
Fredrik Lundh 5810064476 -- changed findall to return empty strings instead of None
for undefined groups
2000-08-09 09:14:35 +00:00
Jack Jansen 0d15908629 Added a missing } in the USE_STACKCHECK code. 2000-08-07 21:02:50 +00:00
Fredrik Lundh 7898c3e685 -- reset marks if repeat_one tail doesn't match
(this should fix Sjoerd's xmllib problem)
-- added skip field to INFO header
-- changed compiler to generate charset INFO header
-- changed trace messages to support post-mortem analysis
2000-08-07 20:59:04 +00:00
Fredrik Lundh 18c2aa25a1 + if USE_STACKCHECK is defined, use PyOS_CheckStack to look
for excessive recursion.
2000-08-07 17:33:38 +00:00
Vladimir Marangozov f9d20c3786 Neil Schemenauer: GC enable(), disable(), isenabled() interface.
Small stylistic changes by VM:
- is_enabled() -> isenabled()
- static ... Py_<func> -> static ... gc_<func>
2000-08-06 22:45:31 +00:00
Moshe Zadka cf4d8ccb05 Removed unnecessary local variable -- gave warning on gcc -Wall 2000-08-04 22:31:42 +00:00
Moshe Zadka 6a078edb07 Removing warnings discovered by gcc -Wall 2000-08-04 15:53:06 +00:00
Guido van Rossum c4a19e7fe9 Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.
This doesn't change the copyright status for these files -- just the
markings!  Doing it on the main branch for these three files for which
the HEAD revision was pushed back into 1.6.
2000-08-03 16:42:14 +00:00
Fredrik Lundh 96ab46529b -- added recursion limit (currently ~10,000 levels)
-- improved error messages
-- factored out SRE_COUNT; the same code is used by
   SRE_OP_REPEAT_ONE_TEMPLATE
-- minor cleanups
2000-08-03 16:29:50 +00:00
Guido van Rossum 16b1ad9c7d Changing the CNRI copyright notice according to CNRI's instructions.
This is a notice without a date, which apparently is not a claim to
copyright but only advice to the reader.  IANAL. :-)
2000-08-03 16:24:25 +00:00
Andrew M. Kuchling a1abb728bc Use METH_OLDARGS instead of numeric constant 0 in method def. tables 2000-08-03 02:34:44 +00:00
Andrew M. Kuchling e365fb8d1f Use METH_VARARGS instead of numeric constant 1 in method def. tables 2000-08-03 02:06:16 +00:00
Andrew M. Kuchling 14f515844d Use METH_VARARGS instead of numeric constant 1 2000-08-03 02:04:05 +00:00
Guido van Rossum a2214c37fd Rob Hooft (Patch #101046): use PyArg_ParseTuple everywhere. 2000-08-02 20:46:51 +00:00
Andrew M. Kuchling 3b96d0b199 Fix for bug #110651 (Jitterbug PR#343): only use the low 8 bits of an octal
escape, as documented in the comment for the check_escape() function
2000-08-02 13:41:18 +00:00
Fredrik Lundh e186983842 final 0.9.8 updates:
-- added REPEAT_ONE operator
-- added ANY_ALL operator (used to represent "(?s).")
2000-08-01 22:47:49 +00:00
Fredrik Lundh 2f2c67d7e5 -- fixed width calculations for alternations
-- fixed literal check in branch operator
   (this broke test_tokenize, as reported by Mark Favas)
-- added REPEAT_ONE operator (still not enabled, though)
-- added some debugging stuff (maxlevel)
2000-08-01 21:05:41 +00:00
Tim Peters 329e29198d Removed decl of unreferenced vrbl. 2000-08-01 21:00:58 +00:00
Fredrik Lundh 29c4ba9ada SRE 0.9.8: passes the entire test suite
-- reverted REPEAT operator to use "repeat context" strategy
   (from 0.8.X), but done right this time.
-- got rid of backtracking stack; use nested SRE_MATCH calls
   instead (should probably put it back again in 0.9.9 ;-)
-- properly reset state in scanner mode
-- don't use aggressive inlining by default
2000-08-01 18:20:07 +00:00