Commit Graph

2231 Commits

Author SHA1 Message Date
Fred Drake 1d531997a6 Fix the fcntl() docstring so the user is not mis-directed to the FCNTL
module for useful constants.
2001-05-10 15:54:32 +00:00
Tim Peters 1ee77d9b71 Guido has Spoken. Restore strop.replace()'s treatment of a 0 count as
meaning infinity -- but at least warn about it in the code!  I pissed
away a couple hours on this today, and don't wish the same on the next
in line.
Bugfix candidate.
2001-05-10 01:23:39 +00:00
Tim Peters da45d55a6e The strop module and test_strop.py believe replace() with a 0 count
means "replace everything".  But the string module, string.replace()
amd test_string.py believe a 0 count means "replace nothing".
"Nothing" wins, strop loses.
Bugfix candidate.
2001-05-10 00:59:45 +00:00
Tim Peters 9c012af3c3 Heh. I need a break. After this: stropmodule & stringobject were more
out of synch than I realized, and I managed to break replace's "count"
argument when it was 0.  All is well again.  Maybe.
Bugfix candidate.
2001-05-10 00:32:57 +00:00
Tim Peters 4cd44ef4bf Fudge. stropmodule and stringobject both had copies of the buggy
mymemXXX stuff, and they were already out of synch.  Fix the remaining
bugs in both and get them back in synch.
Bugfix release candidate.
2001-05-10 00:05:33 +00:00
Tim Peters 1a7b3eee94 SF bug #422088: [OSF1 alpha] string.replace().
Platform blew up on "123".replace("123", "").  Michael Hudson pinned the
blame on platform malloc(0) returning NULL.
This is a candidate for all bugfix releases.
2001-05-09 23:00:26 +00:00
Tim Peters 0f8b494df6 Mechanical changes for easier edits. 2001-05-09 22:15:03 +00:00
Fred Drake 152a25ee1c Modify to allow file objects wherever file descriptors are needed.
This closes SF bug #231328.

Added all constants needed to use the functions defined in this module
that are not defined elsewhere (the O_* symbols are available in the
os module).  No additonal modules are needed to use this now.
2001-05-09 21:02:02 +00:00
Fred Drake c99ff60573 fdconv(): Do not second guess the error condition returned by
PyObject_AsFileDescriptor() -- it does the same thing everywhere, so
    use it the same way everyone else does so that exceptions are
    consistent.  This means we have less code here, and we do not need to
    resort to hackish ways of getting the Python-visible function name to
    fdconv().
2001-05-09 20:14:09 +00:00
Fred Drake fd16834ca7 Three uses of makesockaddr() used sockaddr buffers that had not be cleared;
this could cause invalid paths to be returned for AF_UNIX sockets on some
platforms (including FreeBSD 4.2-RELEASE), appearantly because there is
no assurance that the address will be nul-terminated when filled in by the
kernel.

PySocketSock_recvfrom():  Use PyString_AS_STRING() to get the data pointer
    of a string we create ourselves; there is no need for the extra type
    check from PyString_AsString().

This closes SF bug #416573.
2001-05-09 19:11:33 +00:00
Tim Peters d6283b84c8 Minor fiddling related to
SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
2001-05-09 18:48:26 +00:00
Fred Drake b2877dd122 Only import termio.h on OSF, and add a comment about why it is needed there.
This header does not exist on all Unix flavors; FreeBSD in particular does
not include it.

This closes SF bug #422320.
2001-05-09 17:53:06 +00:00
Fred Drake b638aafef2 Michael Hudson <mwh21@cam.ac.uk>:
This patch does several things to termios:

(1) changes all functions to be METH_VARARGS
(2) changes all functions to be able to take a file object as the
    first parameter, as per

http://mail.python.org/pipermail/python-dev/2001-February/012701.html

(3) give better error messages
(4) removes a bunch of comments that just repeat the docstrings
(5) #includes <termio.h> before #including <sys/ioctl.h> so more
    #constants are actually #defined.
(6) a couple of docstring tweaks

I have tested this minimally (i.e. it builds, and
doesn't blow up too embarassingly) on OSF1/alpha and
on one of the sf compile farm's solaris boxes, and
rather more comprehansively on my linux/x86 box.

It still needs to be tested on all the other platforms
we build termios on.


This closes the code portion of SF patch #417081.
2001-05-07 17:55:35 +00:00
Fred Drake 9b03e59deb Remove an obsolete comment and a "return" before fallig off the end of a
void function.
2001-05-03 16:05:46 +00:00
Fred Drake cde79131ea ParserCreate(): Allow an empty string for the namespace_separator argument;
while not generally a good idea, this is used by RDF users, and works
    to implement RDF-style namespace+localname concatenation as defined
    in the RDF specifications.  (This also corrects a backwards-compatibility
    bug.)

Be more conservative while clearing out handlers; set the slot in the
self->handlers array to NULL before DECREFing the callback.

Still more adjustments to make the code style internally consistent.
2001-04-25 16:01:30 +00:00
Tim Peters cf96de052f SF but #417587: compiler warnings compiling 2.1.
Repaired *some* of the SGI compiler warnings Sjoerd Mullender reported.
2001-04-21 02:46:11 +00:00
Jeremy Hylton 43454765c2 Export three optimization (fast locals) flags 2001-04-16 18:42:13 +00:00
Guido van Rossum 13324e1e1f Reverting Moshe's EGD patch *and* Martin's patch to make it work with
OpenSSL versions beore 0.9.5.  This just is too experimental to be
worth it, especially since the user would have to do some severe
hacking of the Modules/Setup file to even enable the EGD code, and
without the EGD code it would always spit out a warning on some
systems -- even when socket.ssl() is not used.  Fixing that properly
is not my job; the EGD patch is clearly not so important that it
should hold up the 2.1 release.
2001-04-16 00:21:33 +00:00
Fredrik Lundh 9c7eab82b3 SRE: made "copyright" string static, to avoid potential linking
conflicts.
2001-04-15 19:00:58 +00:00
Guido van Rossum f68d8e52e7 Make some private symbols static. 2001-04-14 17:55:09 +00:00
Guido van Rossum b0e51b2957 Clean up the unsightly mess around the readline header files. We now
always:

- #undef HAVE_CONFIG_H (because otherwise chardefs.h tries to include
  strings.h)

- #include readline.h and history.h

and we never declare any readline function prototypes ourselves.

This makes it compile with readline 4.2, albeit with a few warnings.
Some of the remaining warnings are about completion_matches(), which
is renamed to rl_completion_matches().

I've tested it with various other versions, from 2.0 up, and they all
seem to work (some with warnings) -- but only on Red Hat Linux 6.2.

Fixing the warnings for readline 4.2 would break compatibility with
3.0 (and maybe even earlier versions), and readline doesn't seem to
have a way to test for its version at compile time, so I'd rather
leave the warnings in than break compilation with older versions.
2001-04-13 18:14:27 +00:00
Guido van Rossum 058dae37a6 I am TENTATIVELY checking in Martin von Loewis's patch for the SSL
problem reported by Neil Schemenauer on python-dev on 4/12/01, wth
subject "Problem with SSL and socketmodule on Debian Potato?".

It's tentative because Moshe objected, but Martin rebutted, and Moshe
seems unavailable for comments.

(Note that with OpenSSL 0.9.6a, I get a lot of compilation warnings
for socketmodule.c -- I'm assuming I can safely ignore these until 2.1
is released.)
2001-04-13 17:54:04 +00:00
Fred Drake 2a5a5ca012 cleanup_helper(): Make sure we invalidate all reference objects
before calling any callbacks.  This is important
                   since the callback objects only look at themselves
                   to determine that they are invalide.  This change
                   avoids a segfault when callbacks use a different
                   reference to an object in the process of being
                   deallocated.

This fixes SF bug #415660.
2001-04-13 17:15:47 +00:00
Guido van Rossum eb0d992520 Slight adaptation of Michael Hudson's patch to test PyDict_Next()
(with modification of existing dict elements!).

This is part of SF patch #409864: lazy fix for Pings bizarre scoping
crash.

The adaptation I made to Michael's patch was to change the error
handling to avoid masking other errors (moving the specific error
message to inside test_dict_inner()), and to insert a test for
dict==NULL at the start.
2001-04-13 17:08:15 +00:00
Guido van Rossum 2242f2fbd0 Unixware 7 support by Billy G. Allie (SF patch 413011) 2001-04-11 20:58:20 +00:00
Guido van Rossum bceccf5f43 Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger 2001-04-10 22:07:43 +00:00
Guido van Rossum 858ca0f229 Include py_curses.h *after* defining _XOPEN_SOURCE_EXTENDED.
Michael Hudson suggested this fox for the Tru64 problem (SF bug
232597).  It looks reasonable, it works on Tru64, and it doesn't beak
anything on Linux, so I say go for it.
2001-04-10 19:53:37 +00:00
Tim Peters d8ae7c2999 Ack -- this module mixes tabs and spaces, and what appears to be a mix
of 2-space and 4-space indents.  Whatever, when I saw the checkin diff it
was clear that what my editor thinks a tab means didn't match this module's
belief.  Removed all the tabs from the lines I added and changed, left
everything else alone.
2001-04-10 04:35:28 +00:00
Tim Peters 3906eb877a On a sizeof(long)==8 machine, ints in range(2**31, 2**32) were getting
pickled into the signed(!) 4-byte BININT format, so were getting unpickled
again as negative ints.  Repaired that.
Added some minimal docs at the top about what I've learned about the pickle
format codes (little of which was obvious from staring at the code,
although that's partly because all the size-related bugs greatly obscured
the true intent of the code).
Happy side effect:  because save_int() needed to grow a *proper* range
check in order to fix this bug, it can now use the more-efficient BININT1,
BININT2 and BININT formats when the long's value is small enough to fit
in a signed 4-byte int (before this, on a sizeof(long)==8 box it always
used the general INT format for negative ints).
test_cpickle works again on sizeof(long)==8 machines.  test_pickle is
still busted big-time.
2001-04-10 04:22:00 +00:00
Tim Peters bfa18f711f Critical fix: if cPickle on a sizeof(long)==8 box is used to read a
binary pickle, and the latter contains a pickle of a negative Python
int i written on a sizeof(long)==4 box (and whether by cPickle or
pickle.py), it's read incorrectly as i + 2**32.  The patch repairs that,
and allows test_cpickle.py (to which I added a relevant test case earlier
today) to work again on sizeof(long)==8 boxes.
There's another (at least one) sizeof(long)==8 binary pickle bug, but in
pickle.py instead.  That bug is still there, and test_pickle.py doesn't
catch it yet (try pickling and unpickling, e.g., 1 << 46).
2001-04-10 01:54:42 +00:00
Fred Drake 29fd0317ba Michael Hudson <mwh21@cam.ac.uk>:
Update the docstrings to no longer refer to the obsolete TERMIOS
module.

This is a partial acceptance of SF patch #413419.
2001-04-09 19:32:52 +00:00
Tim Peters f0e717bdb1 Repair portability of sign extension when reading signed ints on boxes
where sizeof(long)==8.  This *was* broken on boxes where signed right
shifts didn't sign-extend, but not elsewhere.  Unfortunately, apart
from the Cray T3E I don't know of such a box, and Guido has so far
refused to buy me any Cray machines for home Python testing <wink>.

More immediately interesting would be if someone could please test
this on *any* sizeof(long)==8 box, to make sure I didn't break it.
2001-04-08 23:39:38 +00:00
Fred Drake d3908e2952 Effectively revert the previous change: leave the new #include in, but
comment it out with an explanation.  This makes it easier for someone
who wants the additional symbols to try re-enabling it for their platform.
2001-04-05 18:26:31 +00:00
Fred Drake 9b3bc49575 Add an #include of sys/ioctl.h to pick up a lot of the constants supported
in the previous patch.

This closes (again!) SF patch #410267.
2001-04-04 21:19:26 +00:00
Guido van Rossum f5bd684337 Applying SF patch #412553 by Christopher Lee: fix linuxaudiodev
handling of EAGAIN.

This may or may not fix the problem for me (Mandrake 7.2 on a Dell
Optiplex GX110 desktop): I can't hear the output, but it does pass the
test now.  It doesn't fix the problem for Fred (Mandrake 7.2 on a Dell
Inspiron 7500 which has the Maestro sound drivers).  Fred suspects
that it's the kernel version in combination with the driver.
2001-04-02 17:59:02 +00:00
Fred Drake 55a0034682 Michael Hudson <mwh21@cam.ac.uk>:
Add many more constants for some systems.

This closes SF patch #410267.
2001-03-26 17:14:02 +00:00
Fred Drake 4113b137cd get_version_string(): New function -- returns a Python string object that
gives the CVS revision of this file even if it does not include the
    extra RCS "$Revision: " cruft.

initpyexpat():  Use get_version_string() instead of hard-coding magic
    indexes into the RCS string (which may be affected by export options).
2001-03-24 19:58:26 +00:00
Guido van Rossum 9dee48f6e7 Fix a memory leak -- there's no need to INCREF() the result of
newreadlinesobject() in xreadlines().
2001-03-23 18:30:19 +00:00
Tim Peters a5d7b748d9 Revert the 1.8 patch, since it's implicated in nasty blowups (see Pyhon-Dev). 2001-03-23 06:14:28 +00:00
Jeremy Hylton 8bf395f1aa add DEF_BOUND constant 2001-03-22 23:10:44 +00:00
Guido van Rossum 8652522442 Update the Tix version (long overdue :-).
This is SF patch # #409044, by Internet Discovery: "Update tcl/tk/tix
versions".
2001-03-22 22:18:55 +00:00
Fred Drake 82f1480d63 Inform the cycle-detector that the a weakref object no longer needs to be
tracked as soon as it is clear; this can decrease the number of roots for
the cycle detector sooner rather than later in applications which hold on
to weak references beyond the time of the invalidation.
2001-03-22 18:05:30 +00:00
Fred Drake 2c77355937 Make cPickle use the recently-added PyInstance_NewRaw() API to create
instance objects without calling the constructor.  This is the same as
the new.instance() function.
2001-03-22 17:52:17 +00:00
Fredrik Lundh b25e1ad253 sre 2.1b2 update:
- take locale into account for word boundary anchors (#410271)
- restored 2.0's *? behaviour (#233283, #408936 and others)
- speed up re.sub/re.subn
2001-03-22 15:50:10 +00:00
Jeremy Hylton bc32024769 Extend support for from __future__ import nested_scopes
If a module has a future statement enabling nested scopes, they are
also enable for the exec statement and the functions compile() and
execfile() if they occur in the module.

If Python is run with the -i option, which enters interactive mode
after executing a script, and the script it runs enables nested
scopes, they are also enabled in interactive mode.

XXX The use of -i with -c "from __future__ import nested_scopes" is
not supported.  What's the point?

To support these changes, many function variants have been added to
pythonrun.c.  All the variants names end with Flags and they take an
extra PyCompilerFlags * argument.  It is possible that this complexity
will be eliminated in a future version of the interpreter in which
nested scopes are not optional.
2001-03-22 02:47:58 +00:00
Guido van Rossum ec24c1bc32 Don't raise MemoryError in keys() when the database is empty.
This fixes SF bug #410146 (python 2.1b shelve is broken).
2001-03-22 00:19:22 +00:00
Tim Peters 26ae7cd75a SF patch 407758, "timemodule patches for Cygwin", from Norman Vine.
http://sourceforge.net/tracker/?func=detail&aid=407758&group_id=5470&atid=305470
2001-03-20 03:26:49 +00:00
Moshe Zadka 8f4eab2345 Committing patch 405101 2001-03-18 17:11:56 +00:00
Tim Peters 84e87f379e SF bug [ #233200 ] cPickle does not use Py_BEGIN_ALLOW_THREADS.
http://sourceforge.net/tracker/?func=detail&aid=233200&group_id=5470&atid=105470
Wrapped the fread/fwrite calls in thread BEGIN_ALLOW/END_ALLOW brackets
Afraid I hit the "delete trailing whitespace key" too!  Only two "real" sections
of code changed here.
2001-03-17 04:50:51 +00:00
Jeremy Hylton 30c9f3991c Variety of small INC/DECREF patches that fix reported memory leaks
with free variables.  Thanks to Martin v. Loewis for finding two of
the problems.  This fixes SF buf 405583.

There is also a C API change: PyFrame_New() is reverting to its
pre-2.1 signature.  The change introduced by nested scopes was a
mistake.  XXX Is this okay between beta releases?

cell_clear(), the GC helper, must decref its reference to break
cycles.

frame_dealloc() must dealloc all cell vars and free vars in addition
to locals.

eval_code2() setup code must INCREF cells it copies out of the
closure.

The STORE_DEREF opcode implementation must DECREF the object it passes
to PyCell_Set().
2001-03-13 01:58:22 +00:00
Fred Drake 8e68eb61f2 Make sure we close the group and password databases when we are done with
them; this closes SF bug #407504.
2001-03-11 03:03:07 +00:00
Martin v. Löwis c4db476c87 Define sunmath prototypes if sunmath.h was not included. 2001-03-07 10:22:20 +00:00
Martin v. Löwis f58de1bd67 Document SIG_* warning causes on Solaris. 2001-03-06 12:13:56 +00:00
Martin v. Löwis 2b6727bd8a Use Py_CHARMASK for ctype macros. Fixes bug #232787. 2001-03-06 12:12:02 +00:00
Fred Drake f585bef504 Be a bit more strict in setting up the export of the C API for this
module; do not attempt to insert the API object into the module dict
if there was an error creating it.
2001-03-03 19:41:55 +00:00
Fred Drake d85556c663 Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
some fairly recent versions have an anaemic selection of terminal-control
symbols.

This closes SF bug #405567.
2001-03-03 18:08:52 +00:00
Guido van Rossum ad2c3c7b69 Extra fix from bbum (SF #402357) for his previous patch:
It should use the normal CC referenced compiler as ObjC is integrated
  directly into gcc and enabled through the use of the -ObjC flag.
2001-03-02 07:09:54 +00:00
Guido van Rossum 258ccd4126 Fix typo in RISCOS patch inside MS #ifdef. (Probably my own fingers.) 2001-03-02 06:53:29 +00:00
Fred Drake dedbebf9f8 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
these can be missing on some (all?) Irix and Tru64 versions.

Protect the CRTSCTS value with a cast; this can be a larger value on
Solaris/SPARC.

This should fix SF tracker items #405092, #405350, and #405355.
2001-03-02 06:50:58 +00:00
Guido van Rossum 48a680c097 RISCOS changes by dschwertberger. 2001-03-02 06:34:14 +00:00
Guido van Rossum 1ca8bb374e RISCOS changes by dschwertberger 2001-03-02 06:28:17 +00:00
Guido van Rossum 3ed4c15a88 RISCOS changes by dschwertberger. 2001-03-02 06:18:03 +00:00
Fred Drake 9ef7fa875a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
defined and export both names.

Solaris also does not define CBAUDEX; it is not clear that CBAUDEXT
(which is defined there) is the same thing, so we only protect against
the lack of CBAUDEX.

Reported by Greg V. Wilson.
2001-03-01 21:54:49 +00:00
Fred Drake bb66a200be Wrap some long lines, use only C89 /* */ comments, and add spaces around
some operators (style guide conformance).
2001-03-01 20:48:17 +00:00
Fred Drake abb379e189 Revised version of Jason Tishler's patch to make this compile on Cygwin,
which does not define all the constants.

This closes SF tracker patch #404924.
2001-03-01 03:28:08 +00:00
Tim Peters 5687ffe0c5 SF patch 404928: Support for next Cygwin gcc (2.95.2-8) 2001-02-28 16:44:18 +00:00
Fred Drake df48d14f44 Define the constants needed for working with these functions directly
in this module; no more need for TERMIOS.py.
2001-02-27 21:22:39 +00:00
Andrew M. Kuchling 6efc6e7832 Patch #404680: disables the nis module and enables the dl module when
building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.
2001-02-27 20:54:23 +00:00
Fred Drake ed5e8234d7 Gustavo Niemeyer <niemeyer@conectiva.com>:
Fixed recno support (keys are integers rather than strings).
Work around DB bug that cause stdin to be closed by rnopen() when the
DB file needed to exist but did not (no longer segfaults).

This closes SF tracker patch #403445.

Also wrapped some long lines and added whitespace around operators -- FLD.
2001-02-27 18:56:46 +00:00
Martin v. Löwis 5e1633365d Patch #403985: Add support for weak-keyed dictionaries 2001-02-27 18:36:56 +00:00
Skip Montanaro 8216c18984 conditionally include unistd.h to pick up confstr declaration. attempt to
squelch warning from GCC 2.95.2 on Solaris - partially addresses bug
#232787.
2001-02-27 17:04:34 +00:00
Andrew M. Kuchling ab354bb9ba Mention setup.py in the instructions
Add note about linuxaudiodev possibly working on BSD
2001-02-27 03:29:52 +00:00
Fred Drake 32efcdbceb cleanup_helper(): Added missing "void" type for the function, updated
comments to reflect reality.
2001-02-26 20:10:51 +00:00
Fred Drake b60654bc15 The return value from PyObject_ClearWeakRefs() is no longer meaningful,
so make it void.
2001-02-26 18:56:37 +00:00
Barry Warsaw 3e13b1e48b Py_Main(): When compiled by Insure (i.e. __INSURE__ is defined), call
the internal API function to release the interned strings as the very
last thing before returning status.  This aids in memory use debugging
because it eliminates a huge source of noise from the reports.  This
is never called during normal (non-debugging) use because releasing
the interned strings slows Python's shutdown and isn't necessary
anyway because the system will always reclaim the memory.
2001-02-23 16:46:39 +00:00
Tim Peters 1c8e1f0654 asin micro-optimization suggested in email. 2001-02-22 19:51:56 +00:00
Andrew M. Kuchling a1a690fa9c Patch #103926: fix two warnings from Tru64's compiler 2001-02-22 15:52:55 +00:00
Andrew M. Kuchling b995509c2f Remove soundex module, as stated by GvR.
(Fred, I'll leave the doc changes to you, because I don't know if you
     want to delete libsoundex.tex or leave it in.
     Someone else will have to tweak PC/os2vacpp/{config.c,makefile} and
     PCbuild/pythoncore.dsp, both of which refer to soundex.c)
2001-02-22 15:45:46 +00:00
Tim Peters 793de09b21 Add a line to "python -h" output about PYTHONCASEOK. 2001-02-22 00:39:47 +00:00
Andrew M. Kuchling 39c4ed6e70 Move the signal module back into Setup.config.in so it can be enabled
and disabled from the configure script.
2001-02-21 21:10:14 +00:00
Tim Peters edf2210221 Bug #133297: cmath.asin is the same as cmath.asinh.
The bug report title isn't correct, but was on the right track.
Rev 2.13 applied a patch intended to improve asinh and acosh, but the
author mistakenly replaced the body of asin with their new code for asinh.
See bug report for all the gory details.
This patch: (a) puts the "new" (as of 2.13) asinh code into the asinh
function; and, (b) repairs asin via what Abramowitz & Stegun say it should
be (which is probably the same as what 2.12 did for asin, although I got
tired of matching parentheses before being 100% sure of that -- and I don't
care!  The source of the old code is a mystery, and I *know* why I picked
the new code.).
2001-02-21 03:22:39 +00:00
Andrew M. Kuchling 9aff4a2ad0 Patch #103373 from Donovan Baarda: This patch:
* fixes the zlib decompress sync flush bug as reported in bug #124981
  * avoids repeat calls to (in|de)flateEnd when destroying (de)compression
    objects
  * raises exception when allocating unused_data fails
  * fixes memory leak when allocating unused_data fails
  * raises exception when allocating decompress data fails
  * removes vestigial code from decompress flush now that decompression
    returns all available data
  * tidies code so object compress/decompress/flush routines are consistent
2001-02-21 02:15:56 +00:00
Tim Peters 8cb82bd5fb Rename some constants for easier readability. 2001-02-20 20:36:38 +00:00
Tim Peters 14e26408f3 Mechanical edits just so I can read it. 2001-02-20 20:15:19 +00:00
Fred Drake c9f7c262bd Wrap a bunch of long lines. 2001-02-19 21:16:00 +00:00
Fredrik Lundh b95896b2d2 renamed internal functions to avoid name clashes under OpenVMS
(fixes bug #132815)
2001-02-18 22:06:17 +00:00
Fredrik Lundh ae7636753e stupid typo (for some reason, this only caused problems on OpenVMS). 2001-02-18 11:41:49 +00:00
Fred Drake 7855aba6bb Move docstrings out of function table to constants defined near the
function implementations.
2001-02-18 05:20:18 +00:00
Tim Peters 63cb99e4f0 Bug #132816: Compiler warning in PYEXPAT.C for extra ';'
Removed trailing ";" in instances of "};" closing code blocks.
2001-02-17 18:12:50 +00:00
Fred Drake 6bfa31c5a0 Remove the old version of my_StartElementHandler(). This was conditionally
compiled only for some versions of Expat, but was no longer needed as the
new implementation works for all versions.  Keeping it created multiple
definitions for Expat 1.2, which caused compilation to fail.
2001-02-16 20:46:26 +00:00
Neil Schemenauer 67ea6d8502 Remove a hard coded Python version, and a now incorrect relative path. Closes
SF patch #103680.
2001-02-16 03:27:35 +00:00
Neil Schemenauer f0a87ee955 Moved BeOS/ar-fake and BeOS/linkmodule to Modules/ar_beos and
Modules/ld_so_beos.  Closes SF patch #103679.
2001-02-16 03:24:50 +00:00
Thomas Wouters 0f954a4256 Add a few more missing prototypes to the SunOS 4.1.4 section (no SF
bugreport, just an IRC one by Marion Delgado.) These prototypes are
necessary because the functions are tossed around, not just called.
2001-02-15 08:46:56 +00:00
Fred Drake bd6101c3dc xmlparseobject: Remove the unused conv_attrs field, added an
in_callback field that's set to true whenever a callback into an
    event handler is true.  Needed for:

set_error():  Add line number of offset information to the exception
    as attributes, so users don't need to parse the text of the
    message.

set_error_attr():  New helper function for set_error().

xmlparse_GetInputContext():  New function of the parser object;
    returns the document source for an event during a callback, None
    at all other times.

xmlparse_SetParamEntityParsing():  Make the signature consistent with
    the other parser methods (use xmlparseobject* for self instead of
    PyObject*).

initpyexpat():  Don't lose the reference to the exception class!

call_with_frame(),
getcode():  Re-indent to be consistent with the rest of the file.
2001-02-14 18:29:45 +00:00
Tim Peters 5c4d5bfaf5 Related to SF bug 132008 (PyList_Reverse blows up).
_testcapimodule.c
    make sure PyList_Reverse doesn't blow up again
getargs.c
    assert args isn't NULL at the top of vgetargs1 instead of
    waiting for a NULL-pointer dereference at the end
2001-02-12 22:13:26 +00:00
Fred Drake c17b3cfec1 Richard Fish <rfish@users.sourceforge.net>:
Fix the .binary() method of mpz objects for 64-bit systems.

[Also removed a lot of trailing whitespace elsewhere in the file. --FLD]

This closes SF patch #103547.
2001-02-12 16:48:13 +00:00
Jeremy Hylton cafd495dfe In O_writelines: Replace use of string.joinfields with "".join. 2001-02-09 23:44:22 +00:00
Jeremy Hylton cb17ae8b19 Relax the rules for using 'from ... import *' and exec in the presence
of nested functions.  Either is allowed in a function if it contains
no defs or lambdas or the defs and lambdas it contains have no free
variables.  If a function is itself nested and has free variables,
either is illegal.

Revise the symtable to use a PySymtableEntryObject, which holds all
the revelent information for a scope, rather than using a bunch of
st_cur_XXX pointers in the symtable struct.  The changes simplify the
internal management of the current symtable scope and of the stack.

Added new C source file: Python/symtable.c.  (Does the Windows build
process need to be updated?)

As part of these changes, the initial _symtable module interface
introduced in 2.1a2 is replaced.  A dictionary of
PySymtableEntryObjects are returned.
2001-02-09 22:22:18 +00:00
Fred Drake 85d835f0ab set_error(): Handle construction of pyexpat.error exceptions. They
now carry a 'code' attribute that gives the Expat error
              number.

Added support for additional handlers for Expat 1.95.*, including
XmlDeclHandler, EntityDeclHandler, ElementDeclHandler, and
AttlistDeclHandler.  Associated constants are in the 'model'
sub-object.

Added two new attributes to the parser object: ordered_attributes and
specified_attributes.  These are used to control how attributes are
reported and which attributes are reported.
2001-02-08 15:39:08 +00:00
Andrew M. Kuchling b38175ef3d Remove the optional integer argument to SSL_write; now it will always send
the entire string passed to it
2001-02-07 20:41:17 +00:00
Andrew M. Kuchling 8820a535c1 Patch #103636: Allow writing strings containing null bytes to an SSL socket 2001-02-06 22:58:05 +00:00
Andrew M. Kuchling 22aa6447b4 Patch #103523, to make mpz module compile with Cygwin 2001-02-06 22:33:45 +00:00
Martin v. Löwis 76192ee4f5 Support older PYTHON_API_VERSIONs for backwards compatibility. 2001-02-06 09:34:40 +00:00
Tim Peters f36fb69fd2 Another _testXXX -> _testcapiXXX renaming. 2001-02-04 09:18:21 +00:00
Tim Peters d66595fe42 Renamed _testXXX to _testcapiXXX. Jack is my hero -- good call! 2001-02-04 03:09:53 +00:00
Neil Schemenauer 693291ba23 Superseded by $(srcdir)/Makefile.pre.in. 2001-02-03 17:18:21 +00:00
Tim Peters 231e22facb Repair legit compiler warning. 2001-02-02 21:10:53 +00:00
Jeremy Hylton dbfb66296c fix a couple last-minute bugs in the raw socket support 2001-02-02 19:55:17 +00:00
Jeremy Hylton 5e7cb240af Add minimal interface to symtable: _symtable module. 2001-02-02 18:24:26 +00:00
Marc-André Lemburg bc7cbcbc8f Added new Python C API _test module to the build mechanism on Unix. 2001-02-02 12:07:22 +00:00
Tim Peters 9ea17ac595 Patch derived from Trent's 101162: a Python/C API testing framework.
STILL NEEDS UNIX BUILD CHANGES.
2001-02-02 05:57:15 +00:00
Jeremy Hylton 2230865043 SF patch 101137 from Grant Edwards
Adds support for raw packets (AF_PACKET) under Linux.  I haven't
tested this code thoroughly; it compiles and the basic calls all work
without crashing.  Not sure what to actually do with raw sockets though.

Not sure what other platforms this might be useful for.
2001-02-02 03:23:09 +00:00
Tim Peters 747d5b63db Teach Windows build about the _weakref module. 2001-02-02 00:07:07 +00:00
Jeremy Hylton 42dd01add5 An ssl-wrapped socket now returns '' on EOF, just like a regular
socket -- as suggested by Clarence Gardner.

Fix httplib to comply with the new ssl-socket interface.
2001-02-01 23:35:20 +00:00
Jeremy Hylton 6fe0a82ecb move extra arguments to the back of the new.code() arglist 2001-02-01 19:50:29 +00:00
Fred Drake 41deb1efc2 PEP 205, Weak References -- initial checkin. 2001-02-01 05:27:45 +00:00
Fred Drake 2de7471d69 Add entries for the weakref module to the build control. 2001-02-01 05:26:54 +00:00
Tim Peters ee826f88c9 Docs for new Windows zlib build procedure. 2001-01-31 19:39:44 +00:00
Mark Hammond ae8c268a2b Fix [ Bug #129293 ] zlib library used for binary win32 distribution can crash
This involves changing the zlib build process to build zlib itself from sources, then use that library.  Also updated are the comments to reflect the new official home of zlib, and add Windows specific notes regarding the build process.
2001-01-31 10:28:03 +00:00
Mark Hammond 0850137fe4 Partial fix to [ Bug #128685 ] popen on Win9x isnt smart enough about finding w9xpopen.exe.
"Partial" as the code uses sys.prefix in an attempt to locate 'w9xpopen.exe', but sys.prefix is not set if Python can't find it itself.  So this _still_ fails in Pythonwin, but I am committing the patch for 2 reasons:
* Embedded apps that set sys.prefix or use PYTHONHOME will work
* The exception raised on failure to find the executable is far more obvious
2001-01-31 07:30:29 +00:00
Mark Hammond 64aae6695f Fix Bug #125891 - os.popen2,3 and 4 leaked file objects on Windows. 2001-01-31 05:38:47 +00:00
Jeremy Hylton 55087f0c35 Cleanup logic a little. Check args first, then try to create the
object.  This avoids creation + decref if bogus arguments are passed.
2001-01-29 22:46:35 +00:00
Andrew M. Kuchling 2d339f9369 Patch #103485 from Donn Cave: patches to make the module compile on AIX and
NetBSD
2001-01-29 20:47:59 +00:00
Andrew M. Kuchling e1c4352f98 Rename 'lines' variable to 'nlines' to avoid conflict with a macro defined
in term.h
2001-01-29 20:31:29 +00:00
Andrew M. Kuchling e7c6691796 Add back most of the old contents of Setup.dist, with all the modules
commented out.
2001-01-29 20:13:11 +00:00
Andrew M. Kuchling 399b8af563 Bug #130117: add a prototype required to compile cleanly on IRIX
(contributed by Paul Jackson)
2001-01-28 18:10:23 +00:00
Fred Drake ceb2bff09e new_instance(): Use PyInstance_NewRaw() instead of knowing too much
about the internal initialization of instance objects.  Make the
    dict parameter optional, and allow None as equivalent to omission.
2001-01-28 03:55:09 +00:00
Neil Schemenauer 09ac1fde1c Fix a typo. 2001-01-27 21:43:40 +00:00
Fred Drake 2174f80c66 init_curses_panel(): Be more consistent with indentation and blank lines. 2001-01-27 18:58:04 +00:00
Andrew M. Kuchling 93b747efce Bug #129904: Put back the path component for the Tkinter modules 2001-01-27 01:31:35 +00:00
Neil Schemenauer 83356ef31d - Use PY_CFLAGS when compile modules that will be part of the interpreter.
- Put shared modules in the same place as object files.
2001-01-26 16:22:26 +00:00
Guido van Rossum 2b597e4f54 Correct one-line typo, reported by yole @ SF, bug 130077. 2001-01-25 22:12:43 +00:00
Jeremy Hylton 78dc825a41 Fix arguments for PyFrame_New(). The previous checkin used the wrong
arguments, which were based on an interim development API.
2001-01-25 21:48:14 +00:00
Jeremy Hylton 903f654ac9 PEP 227 implementation
Track changes to PyFrame_New() and PyFuntion_New().
2001-01-25 20:07:56 +00:00
Sjoerd Mullender 82e00d6350 Let's keep things portable to non GCC compilers, please.
You can only use mult-line strings in C if each line ends in \.
2001-01-25 10:10:39 +00:00
Barry Warsaw bd3dc1f0cb lockf_doc: a much better description of the lockf() function, based on
an eyeballing of the code.
2001-01-25 00:20:13 +00:00
Guido van Rossum 05bbb9a8fb The array type was missing the Py_TPFLAGS_DEFAULT initializer for the
tp_flags.  This will become important when I introduce
Py_TPFLAGS_HAVE_RICHCOMPARE (as I should have!).
2001-01-24 21:44:21 +00:00
Neil Schemenauer d32a337cf3 Changes for flat makefile. Building of modules happens from toplevel
directory.  Modify meaning of -s option to specify the Modules directory.
Add -l option to specify library source directory when building extension
modules.  Perhaps these names should be switched to avoid breaking old
code.  Add -c compiler option to when emitting rules to build object files.
2001-01-24 17:16:22 +00:00
Neil Schemenauer 6cf0702a79 Build now happens in toplevel directory, not Modules. Don't monkey with
VPATH.
2001-01-24 17:13:11 +00:00
Fredrik Lundh 9f30b753b2 ucnhash is no longer used 2001-01-24 08:20:40 +00:00
Fredrik Lundh 42e655908a ucnhash is no longer used 2001-01-24 08:02:00 +00:00
Fredrik Lundh 06d126803c Move uchhash functionality into unicodedata (after the recent
crop of changes, the files are small enough to do this).  Also
adds "name" and "lookup" functions to unicodedata.
2001-01-24 07:59:11 +00:00
Barry Warsaw 9ac33509de _PyImport_Inittab: define the exceptions module's init function.
Fixes bug #121706.
2001-01-23 21:46:57 +00:00
Guido van Rossum d0e74eac6b Clean up some comments and the default VERSION. 2001-01-23 01:57:40 +00:00
Guido van Rossum 25b163d579 Get rid of weird @SET_CXX@ and @SET_DLLLIBRARY@ macro occurrences. 2001-01-23 01:54:07 +00:00
Guido van Rossum 2528b19a86 Use PyThreadState_DeleteCurrent() instead of PyThreadState_Delete()
and PyEval_ReleaseThread().

This fixes SF bug #125673 PyThreadState_Delete: invalid tstate (Unix
only?).
2001-01-23 01:47:18 +00:00
Guido van Rossum a120ffcf12 SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin 2001-01-22 15:29:14 +00:00
Martin v. Löwis 3af7cc034c Fix off-by-one error in array size. 2001-01-22 08:19:10 +00:00
Fredrik Lundh d852e46be4 unicodedatabase.[ch] are no longer used. 2001-01-22 07:28:10 +00:00
Fredrik Lundh f147c30199 removed unicodedatabase.[ch] references from Makefile.pre.in.
also added unicodename_db.h dependency to ucnhash.
2001-01-22 07:25:44 +00:00
Tim Peters e815786858 Fixed teensy memory leak, but doesn't help test_sax on Windows. 2001-01-22 03:20:55 +00:00
Thomas Wouters e75e6d06d2 Move declaration of 'clnt_create()' NIS function to pyport.h, as it's
supposed to be declared in system include files (with a proper prototype.)
Should be moved to a platform-specific block if anyone finds out which
broken platforms need it :-)
2001-01-21 23:34:12 +00:00
Fredrik Lundh b2dfd73bdc Unicode nits: Don't include unicodedatabase.h no more. And make sure
to build *all* tables in makeunicodedata.py.
2001-01-21 23:31:52 +00:00
Fredrik Lundh 7b7dd107b3 compress unicode decomposition tables (this saves another 55k) 2001-01-21 22:41:08 +00:00
Fredrik Lundh 9e9bcda547 forgot to check in the new makeunicodedata.py script 2001-01-21 17:01:31 +00:00
Martin v. Löwis 6512dbd5be Fix typo: MICRO instead of MINOR. 2001-01-21 10:22:12 +00:00
Martin v. Löwis 0078f6cc80 Merge with 1.25 of PyXML:
Participate in garbage collection if available.
Potentially decref handlers in clear_handlers.
Partially reindent.
Put synthetic frame object on the stack to support better error output.
Expose Python codecs to pyexpat.
Add new Expat 1.2 handlers and API.
Fix memory leak: release self->handlers.
Do not expect PyModule_AddObject and PyModule_AddStringConstant in 2.0b1.
Raise exception in ParseFile.
2001-01-21 10:18:10 +00:00
Thomas Wouters fe385251f4 Make the 'time' argument to the timemodule functions strftime, asctime,
ctime, gmtime and localtime optional, defaulting to 'the current time' in
all cases. Adjust docs, add news item. Also convert all argument-handling to
METH_VARARGS. Closes SF patch #103265.
2001-01-19 23:16:56 +00:00
Fredrik Lundh 7c1e4bbe25 gethash/cmpname both looked beyond the end of the character name.
This patch makes u"\N{x}" a bit less dependent on pure luck...
2001-01-19 19:45:02 +00:00
Andrew M. Kuchling ae89af9c63 Minor patch from Thomas Gellekum:
* Deletes the Panel_NoArgReturnStringFunction() macro, which isn't used
     anymore
   * Adjusts two comments.
2001-01-19 15:35:26 +00:00
Fredrik Lundh 95f1e6f631 new unicode name database (~160k) 2001-01-19 11:52:33 +00:00
Fredrik Lundh ee865c64da added "getcode" and "getname" methods to the ucnhash module (they're
probably more useful for the test code than for any applications, but
one never knows...)
2001-01-19 11:00:42 +00:00
Fredrik Lundh 0fdb90cafe refactored the unicodeobject/ucnhash interface, to hide the
implementation details inside the ucnhash module.

also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...
2001-01-19 09:45:02 +00:00
Guido van Rossum 7150a77863 SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin
Support building this as a DLL under Cygwin.
2001-01-19 00:29:06 +00:00
Guido van Rossum 6915c4d0a8 Support building this as a DLL under Cygwin. 2001-01-19 00:28:08 +00:00
Andrew M. Kuchling 697a0b0f96 Use openssl/*.h to include the OpenSSL header files 2001-01-18 17:41:41 +00:00
Guido van Rossum 9d19cb8a70 Same treatment as listobject.c:
- In count(), remove(), index(): call RichCompare(Py_EQ).

- Get rid of array_compare(), in favor of new array_richcompare() (a
  near clone of list_compare()).

- Aligned items in array_methods initializer and comments for type
  struct initializer.

- Folded a few long lines.
2001-01-18 01:02:55 +00:00
Andrew M. Kuchling 6425efe9ae The signal module has to be compiled statically, so add it to Setup.dist
and remove support for it from setup.py
2001-01-17 22:17:16 +00:00
Andrew M. Kuchling 33b4d50180 strop doesn't actually seem to be needed 2001-01-17 20:21:30 +00:00
Ka-Ping Yee 7dfe6e3264 Restore lost AFMT_S16_NE entry. 2001-01-17 19:31:29 +00:00
Andrew M. Kuchling 3712d396ac Patch #102588 / PEP 229:
The final piece of this change...

   Strip down Setup.config.in and Setup.dist to the minimal sets required
       to get a working Python; setup.py will handle the rest
2001-01-17 18:55:13 +00:00
Eric S. Raymond a888540593 Eric the half-a-wit, driven to berserk rage after repeatedly doing
builds during which he forgot to uncomment crucial library lines in
Setup, walks into Guido's East End nightclub with a tactical nuclear
weapon on his shoulder.  Said nuclear weapon is promptly deployed
exactly where it will do the most good, right in the middle of
configure.in.

With this patch, the set of libraries autoconfigured in is extended to
include ndbm, gdbm, and crypt.  This essentially eliminates any need to
tweak Setup for a normal Linux build.

"'E was a fair man.  Cruel, but fair."
2001-01-17 08:25:11 +00:00
Fredrik Lundh 1c5aa6901f bumped SRE version number to 2.1. cleaned up and added 1.5.2
compatibility patches.
2001-01-16 07:37:30 +00:00
Fredrik Lundh 6f5cba68fc fixed a memory leak in pattern cleanup (patch #103248 by cgw) 2001-01-16 07:05:29 +00:00
Neil Schemenauer 19030a08fb Plug memory leak. 2001-01-16 04:27:47 +00:00
Ka-Ping Yee 27ac0d1ff5 better format names and error messages 2001-01-15 22:21:39 +00:00
Barry Warsaw a57b89b492 Committing patch #103216, autodetect of dbmmodule support and building
of dbmmodule dynamically by default (otherwise it can pull in
dependencies with libdb that croak pybsddb3).  This change moves the
Setup line for dbmmodule to Setup.config.in.
2001-01-15 17:07:21 +00:00
Fredrik Lundh b35ffc0417 added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
2001-01-15 12:46:09 +00:00
Fredrik Lundh fa25a7d51f -- don't use recursion for unbounded non-greedy repeat
(bugs #115903, #115696)

This is based on a patch by Darrel Gallion.  I'm not 100%
sure about this fix, but I haven't managed to come up with
any test case it cannot handle...
2001-01-14 23:55:55 +00:00
Fredrik Lundh 770617b23e SRE fixes for 2.1 alpha:
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
   had already been fixed by AMK)
2001-01-14 15:06:11 +00:00
Tim Peters 2caf8df868 SF bug 128713: type(mmap_object) blew up on Linux. 2001-01-14 05:05:51 +00:00
Thomas Wouters 9fdcf4ad39 Conform the new module to /the/ C style.
Noone but me cares, but Guido said to go ahead and fix it if it bothered me.
2001-01-11 15:40:39 +00:00
Thomas Wouters ade16076a1 Move the _socket module closer to the SSL-_socket line (mmap and
xreadlines inserted themselves inbetween the two) and clarify that the
normal socket module should be commented out. (Someone also suggested the
latter on c.l.py some time ago, I forget who, sorry.)
2001-01-11 14:46:40 +00:00
Guido van Rossum 2a78cf2288 SF Patch #102357 by bbum: Add support for frameworks and objective-c
source. Uesful for both GnuStep and for OSXS/OSX/Darwin.

(Note: I changed $(CCC) to $(CXX) since that's now the name of the C++
compiler.  Please test!
2001-01-10 21:46:05 +00:00
Guido van Rossum b961920ff4 Final part of SF patch #102409 by jlt63: Cygwin Python DLL and Shared
Extension Patch.

These are the changes to the Modules Makefile and makesetup script for
Cygwin.
2001-01-10 21:12:18 +00:00
Guido van Rossum 5a53019b0d Part of SF patch #102409 by jlt63 to support building these modules
under CYGWIN as shared libraries (DLLs).
2001-01-10 21:03:32 +00:00
Guido van Rossum 3d15bd8806 Adapted version of Eric Raymond's patches to automatically configure
curses and readline (for Linux, at least).

These are done as shared libraries by default, and so is bsddb -- that
seems to make the most sense.
2001-01-10 18:53:48 +00:00
Tim Peters 0d9f9dcf67 Windows mmap should (as the docs probably <wink> say) create a mapping
without a name when the optional tagname arg isn't specified.  Was
actually creating a mapping with an empty string as the name.
2001-01-10 05:42:18 +00:00
Tim Peters 58c82f0b56 Assorted xreadlines problems:
Wasn't built on Windows; not in config.c either.
    Module init function missing DL_EXPORT magic.
    test_xreadline output file obviously wrong (started w/ "test_xrl").
    test program very unclear about what was expected.
2001-01-09 23:26:39 +00:00
Guido van Rossum ea3375d96b Jeff Epler's xreadlines module, with slight reformatting and some
changes for safety and tuning.
2001-01-09 21:46:50 +00:00
Guido van Rossum 92d8917f83 Address a bug in the uuencode decoder, reported bu "donut" in SF bug
#127718: '@' and '`' seem to be confused.
2001-01-09 02:11:57 +00:00
Guido van Rossum e2ad633051 Anonymous SF bug report #128053 point out that the #ifdef for
including "tmpfile" in the posix_methods[] array is wrong -- should be
HAVE_TMPFILE, not HAVE_TMPNAM.
2001-01-08 17:51:55 +00:00
Fred Drake 711370831a Fix problems with validation of import statement parse trees.
This closes SF bug #127271.
2001-01-07 05:59:59 +00:00
Andrew M. Kuchling 5a571639fc Patch #103012: Update fpectlmodule for current glibc;
The _setfpucw() function/macro doesn't seem to exist any more;
    instead there's an _FPU_SETCW macro.
2001-01-04 01:01:12 +00:00
Fred Drake 2d4ac208b5 Mark the "encoding" parameter to ExternalEntityParserCreate() as optional
in the docstring.
2001-01-03 15:36:25 +00:00
Andrew M. Kuchling caefb37ee1 Add the curses constants ERR and OK to the module at TG's suggestion 2000-12-26 15:57:01 +00:00
Fred Drake 4e36d5885b Shortened / wrapped some long lines.
Removed warning on use of panel_userptr() in PyCursesPanel_userptr().
2000-12-23 05:46:23 +00:00
Andrew M. Kuchling d7d2e19922 Add correction caught by Thomas Gellekum (and sitting in my e-mail) 2000-12-22 22:03:15 +00:00
Andrew M. Kuchling 1a86cbbc32 Add _curses_panel to Setup 2000-12-22 21:57:33 +00:00
Andrew M. Kuchling 7b59ed2ebd Patch #102813: add a wrapper for the panel library included with ncurses.
Original version written by Thomas Gellekum, reshaped into a separate
    module by AMK.
2000-12-22 21:54:12 +00:00