Commit Graph

2694 Commits

Author SHA1 Message Date
Tim Peters 4324aa3572 Cruft cleanup: Removed the unused last_is_sticky argument from the internal
_PyTuple_Resize().
2001-05-28 22:30:08 +00:00
Guido van Rossum c8555b38e7 Iterator support: made the xreadlines object its own iterator. This
ought to be faster.
2001-05-22 16:41:32 +00:00
Fred Drake d0b625d05a Correct the sense of a couple of conditional compilations -- used #ifndef
when #ifdef was needed.

This closes (reallu!) SF bug #417418.
2001-05-22 15:44:15 +00:00
Fred Drake 7b87f85c78 Add :method info to the PyArg_ParseTuple() format strings for poll objects. 2001-05-21 03:29:05 +00:00
Guido van Rossum 2e0a654f6e Add warnings to the strop module, for to those functions that really
*are* obsolete; three variables and the maketrans() function are not
(yet) obsolete.

Add a compensating warnings.filterwarnings() call to test_strop.py.

Add this to the NEWS.
2001-05-15 02:14:44 +00:00
Tim Peters d401eddf91 Fix new compiler warnings. Also boost "start" from (C) int to long and
return a (C) long:  PyArg_ParseTuple and Py_BuildValue may not let us get
at the size_t we really want, but C int is clearly too small for a 64-bit
box, and both the start parameter and the return value should work for
large mapped files even on 32-bit boxes.  The code really needs to be
rethought from scratch (not by me, though ...).
2001-05-14 23:19:12 +00:00
Tim Peters 58e0a8c130 SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen. 2001-05-14 22:32:33 +00:00
Fred Drake 460f0691df fcntl.ioctl(): Update error message; necessity noted by Michael Hudson. 2001-05-14 21:02:36 +00:00
Mark Hammond 26cffde4c2 Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a fileobject.h, and initialize it in bltinmodule. 2001-05-14 12:17:34 +00:00
Greg Stein 834f4dd7c9 Fix the .find() method for memory maps.
1) it didn't obey the "start" parameter (and when it does, we must validate
   the value)
2) the return value needs to be an absolute index, rather than relative to
   some arbitrary point in the file

(checking CVS, it appears this method never worked; these changes bring it
 into line with typical .find() behavior)
2001-05-14 09:32:26 +00:00
Mark Hammond ef8b654bbe Add support for Windows using "mbcs" as the default Unicode encoding when dealing with the file system. As discussed on python-dev and in patch 410465. 2001-05-13 08:04:26 +00:00
Fred Drake 564a6cc8ca Fix a minor style consistency issue.
When getting a string buffer for a string we just created, use
PyString_AS_STRING() instead of PyString_AsString() to avoid the
call overhead and extra type check.
2001-05-11 20:12:26 +00:00
Fred Drake 87068f1eaa Include sys/modem.h if we have it; this is needed on HP-UX to provide
constants used by other macros from the headers.

Conditionalize VREPRINT and VDISCARD; these are not available on HP-UX.

This closes bug #417418.
2001-05-11 16:14:17 +00:00
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
Andrew M. Kuchling 3255268777 Export C API from this module.
Remove several macros and #includes; py_curses.h contains them now.
2000-12-22 21:52:27 +00:00
Andrew M. Kuchling 48f224c877 Fix bug 126587: matchobject.groupdict() leaks memory because of a missing
DECREF
2000-12-22 14:39:10 +00:00
Fred Drake 738293d663 When using the latest & greatest version of Expat (currently in the Expat
CVS repository), provide the library version information.
2000-12-21 17:25:07 +00:00
Andrew M. Kuchling 9de6ffa314 Another patch from Thomas Gellekum: add .overlay() and .overwrite()
window methods
2000-12-21 16:22:22 +00:00
Guido van Rossum b1d136174a Adding a warning about the regex module. This is the first official
use of PyErr_Warn()!  This module is a good guinea pig because it's
been obsolete since 1.5.0 was released.
2000-12-19 18:21:39 +00:00
Guido van Rossum fb10c3f664 Minimal fix for the complaints about pickling Unicode objects. (SF
bugs #126161 and 123634).

The solution doesn't use the unicode-escape encoding; that has other
problems (it seems not 100% reversible).  Rather, it transforms the
input Unicode object slightly before encoding it using
raw-unicode-escape, so that the decoding will reconstruct the original
string: backslash and newline characters are translated into their
\uXXXX counterparts.

This is backwards incompatible for strings containing backslashes, but
for some of those strings, the pickling was already broken.

Note that SF bug #123634 complains specifically that cPickle fails to
unpickle the pickle for u'' (the empty Unicode string) correctly.
This was an off-by-one error in load_unicode().

XXX Ugliness: in order to do the modified raw-unicode-escape, I've
cut-and-pasted a copy of PyUnicode_EncodeRawUnicodeEscape() into this
file that also encodes '\\' and '\n'.  It might be nice to migrate
this into the Unicode implementation and give this encoding a new name
('half-raw-unicode-escape'? 'pickle-unicode-escape'?); that would help
pickle.py too.  But right now I can't be bothered with the necessary
infrastructural changes.
2000-12-19 02:08:38 +00:00
Guido van Rossum 20d3fc071b Adapted from a patch by Barry Scott, SF patch #102875 and SF bug
#125981: closing sockets was not thread-safe.
2000-12-18 22:23:44 +00:00
Neil Schemenauer e9e860faf3 Add support for gdbm2 open flags ('s' and 'u'). Add module constant
open_flags which contains the flags supported by gdbm.  Closes patch
#102802.
2000-12-17 07:14:13 +00:00
Fred Drake e8f3ad560f Add returns_unicode to the __members__ list.
Fix a small style consistency nit.
2000-12-16 01:48:29 +00:00
Guido van Rossum 47f5fdc114 Add the -W option. 2000-12-15 22:00:54 +00:00
Andrew M. Kuchling 2e09530f3f [Patch #102827] Fix for PR#119558, avoiding core dumps by checking for
malloc() returning NULL
2000-12-15 00:59:32 +00:00
Andrew M. Kuchling 2824d7f6b1 Wrapper for napms() function, contributed by Thomas Gellekum <tg@FreeBSD.org> 2000-12-15 00:44:02 +00:00
Jack Jansen 63596aeb33 The Mac C library (MSL from CodeWarrior 6) and I/O library (GUSI
2.1.3) finally agree on when the epoch is, so the code to convert
epochs has been disabled.
2000-12-12 22:42:30 +00:00
Guido van Rossum cfc4cf601c Add URL with info for PIL. 2000-12-12 21:07:08 +00:00
Tim Peters d92dfe0ef5 SF bug 110843: Low FD_SETSIZE limit on Win32 (PR#41). Boosted to 512. 2000-12-12 01:18:41 +00:00
Guido van Rossum f377d57328 Trivial typo fix, submitted by Charles Waldman (SF patch #102794). 2000-12-12 00:37:58 +00:00
Fred Drake b6429a2020 validate_varargslist(): Fix two bugs in this function, one that affected
it when *args and/or **kw are used, and one when
                         they are not.

This closes bug #125375: "parser.tuple2ast() failure on valid parse tree".
2000-12-11 22:08:27 +00:00
Guido van Rossum 37da22b3f4 The C+ compiler is called $(CXX) these days, not CCC.
This fixes SF Bug #124478.
2000-12-06 23:46:29 +00:00
Fred Drake e63544f872 posix_getlogin(): Be more cautious about interpreting a NULL from
getlogin() -- it is not clear that a NULL is always
                   an error.
2000-12-06 21:45:33 +00:00
Fred Drake a30680b240 posix_getlogin(): Handle the possibility that getlogin() can return
NULL without setting errno; observed on Linux
                   Mandrake 7.2 by an anonymous user.

This closes bug #124758.
2000-12-06 21:24:28 +00:00
Guido van Rossum e4dad905d4 Patch by Michael Hudson to clarify the error message from
getsockaddrarg when the address is not a tuple.
2000-12-01 13:13:11 +00:00
Andrew M. Kuchling 469d5bb0b4 Clarify two comments 2000-11-30 01:57:18 +00:00
Guido van Rossum d7aa0f245f Update dependencies per /F. 2000-11-28 12:09:18 +00:00
Andrew M. Kuchling 26cc66fe6a Patch #102412 from mwh: Add support for the setupterm() function, to
initialize the terminal without necessarily calling initscr()
2000-11-18 17:45:59 +00:00
Guido van Rossum 1bff883ac0 Allow new.function() called with explicit 3rd arg of None, as
documented, and as is reasonable (since it is optional, but there's
another argument following it that may require you to specify a
value).  This solves SF bug 121887.
2000-11-13 20:29:20 +00:00
Tim Peters 7c1cb46126 Fix for SF bug 117402, crashes on str(array) and repr(array). This was an
unfortunate consequence of somebody switching from PyArg_Parse to
PyArg_ParseTuple but without changing the argument from a NULL to a tuple.
2000-11-10 19:04:19 +00:00
Andrew M. Kuchling f16e0ed76c Patch #102278: add tparm() function to _curses module 2000-11-07 03:35:24 +00:00
Fredrik Lundh fad27aee11 Added 38,642 missing characters to the Unicode database (first-last
ranges) -- but thanks to the 2.0 compression scheme, this doesn't add
a single byte to the resulting binaries (!)

Closes bug #117524
2000-11-03 20:24:15 +00:00
Thomas Wouters 2cffc7d420 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
2000-11-03 08:18:37 +00:00
Andrew M. Kuchling e7d3616409 Patch from Randall Hopper to fix PR #116172, "curses module fails to
build on SGI":
* Check for 'sgi' preprocessor symbol, not '__sgi__'
* Surround individual character macros with #ifdef's, instead of making them
  all rely on STRICT_SYSV_CURSES
2000-11-01 19:59:12 +00:00
Fred Drake 4ba298c325 ParserCreate(): Added test that the namespace_separator value, if given,
has the required length.

initpyexpat():  Provide the type object for the ParserCreate() return
                value as XMLParserType.
2000-10-29 04:57:53 +00:00
Fred Drake 5f739befe5 Do not echo the echo command with the message telling the user that Setup
may be out of date.
2000-10-29 04:28:48 +00:00
Martin v. Löwis 02956017f9 Do not release unallocated Tcl objects. Closes #117278 and #117167. 2000-10-29 00:44:43 +00:00
Fredrik Lundh ebc37b28fa -- properly reset groups in findall (bug #117612)
-- fixed negative lookbehind to work correctly at the beginning
of the target string (bug #117242)

-- improved syntax check; you can no longer refer to a group
inside itself (bug #110866)
2000-10-28 19:30:41 +00:00
Fred Drake cf3bc8c5a5 Rename Setup.in to Setup.dist, and assume that configure will create
Setup (instead of creating it from the Makefile).
2000-10-26 17:07:40 +00:00
Fred Drake 35f8d46f94 Update a comment to be correct. 2000-10-26 14:57:29 +00:00
Fred Drake 661ea26b3d Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.

This (mostly) closes SourceForge patch #101839.
2000-10-24 19:57:45 +00:00
Fred Drake 9c801abef3 t_bootstram(): Use PySys_WriteStderr() instead of fprintf(stderr,...).
This closes bug #117324.
2000-10-20 20:02:37 +00:00
Fred Drake 8f176accde Update the comments for the BSD DB module, including a new pointer to
the DB 3 module; thanks to Robin Dunn <robind@users.sourceforge.net>.

This closes SourceForge bug #116850.
2000-10-14 04:14:09 +00:00
Tim Peters 2bf405ad55 Repaired a comment and asserted a precondition. 2000-10-12 19:42:00 +00:00
Guido van Rossum ada6d87c0c Fix for Bug #116453.
Direct use of interp->result is deprecated; changing this to
Tcl_GetStringResult(interp) everywhere fixed the problem of losing the
error message with TclError exceptions, on Windows.
2000-10-12 17:14:46 +00:00
Tim Peters 1d120619d4 Stop raising OverflowError on underflows reported by libm (errno==ERANGE and
libm result is 0).  Cautiously add a few libm exception test cases:
1. That exp(-huge) returns 0 without exception.
2. That exp(+huge) triggers OverflowError.
3. That sqrt(-1) raises ValueError specifically (apparently under glibc linked
   with -lieee, it was raising OverflowError due to an accident of the way
   mathmodule.c's CHECK() macro happened to deal with Infs and NaNs under gcc).
2000-10-12 06:10:25 +00:00
Fred Drake 06fdd2d9e8 Another gcc -Wall warning squashed:
MPZ_divm():  Initialize mpzden to NULL, since it could be Py_XDECREF()ed
             without being initialized.
2000-10-11 21:53:34 +00:00
Fred Drake 4747a18ef9 Remove one more gcc -Wall warning. 2000-10-11 21:44:02 +00:00
Fred Drake 5428c7db41 Fix the docstring for new.function().
Based on a comment from Detlef Lannert
<lannert@lannert.rz.uni-duesseldorf.de>.
2000-10-10 22:07:18 +00:00
Fred Drake 9e2e1e5920 Donn Cave <donn@oz.net>:
Updated to work better with BeOS.

This closes SourceForge patch #101777.
2000-10-09 16:48:09 +00:00
Andrew M. Kuchling d923831027 Patch #101810: check whether zst.avail_out is non-zero when getting
a Z_BUF_ERROR while decompressing.  If it is, assume that this means
   the data being decompressed is bad and raise an exception, instead of
   just assuming that Z_BUF_ERROR always means that more space is required.
2000-10-09 14:18:10 +00:00
Guido van Rossum 59316671e3 Be consistent in the description of audio formats: <format> <width>
"audio".

Also add AFMT_S16_NE ("native-endian").  (Somehow there's no AFMT_U16_NE.)
2000-10-08 19:47:47 +00:00
Jeremy Hylton e2b7c4dea3 test_linuxaudio:
read the header from the .au file and do a sanity check
    pass only the data to the audio device
    call flush() so that program does not exit until playback is complete
    call all the other methods to verify that they work minimally
    call setparameters with a bunch of bugs arguments

linuxaudiodev.c:
    use explicit O_WRONLY and O_RDONLY instead of 1 and 0
    add a string name to each of the entries in audio_types[]
    add AFMT_A_LAW to the list of known formats
    add x_mode attribute to lad object, stores imode from open call
    test ioctl return value as == -1, not < 0
    in read() method, resize string before return
    add getptr() method, that calls does ioctl on GETIPTR or GETOPTR
        depending on x_mode
    in setparameters() method, do better error checking and raise
        ValueErrors; also use ioctl calls recommended by Open Sound
        System Programmer's Guido (www.opensound.com)
    use PyModule_AddXXX to define names in module
2000-10-06 19:39:55 +00:00
Jim Fulton e60de4d309 Added a new "base" type, IOobject for which most of the
operations are defined.  This will, hopefully clarify
some of the logic.

Added close test to raise proper error when operations
are performed on closed StringIOs.

Added a position argument to the truncate method.

Added a size argument to readline.

Added PyArg_Parse calls for methods that don't take arguments to
make sure they don't take arguments.
2000-10-06 19:24:23 +00:00
Guido van Rossum 2834b974b6 [ Bug #113803 ] [2.0b1 NT4.0] printing non asci char causes idle to abort
http://sourceforge.net/bugs/?func=detailbug&bug_id=113803&group_id=5470

Add Unicode support and error handling to AsString().  Both AsString()
and Merge() now return NULL and set a proper Python exception
condition when an error happens; Merge() and other callers of
AsString() check for errors from AsString().  Also fixed cleanup in
Merge() and Tkapp_Call() return cleanup code; the fv array was not
necessarily completely initialized, causing calls to ckfree() with
garbage arguments!

(Also reindented some lines that were longer than 80 chars and
reformatted some code that used an alien coding standard.)
2000-10-06 16:58:26 +00:00
Fred Drake 51d9036cc8 Norman Vine <nhv@users.sourceforge.net>:
tcp.h is not available on CygWin, so do not try to include it there.

This closes SourceForge patch #101802.
2000-10-06 15:37:06 +00:00
Tim Peters 98dc065c1b SF "bug" 115973: patches from Norman Vine so that shared libraries and
Tkinter work under Cygwin.  Accepted on faith & reasonableness.
2000-10-05 19:24:26 +00:00
Neil Schemenauer b2c2c9e977 - update Neil's email address 2000-10-04 16:34:09 +00:00
Neil Schemenauer 97d723bd62 - do not start collection during processing of an exception 2000-10-04 16:25:07 +00:00
Neil Schemenauer 5196c586bb - Fix a GC bug caused by PyDict_New() failing. 2000-10-04 16:22:26 +00:00
Fredrik Lundh 562586eb3a Accept keyword arguments for (most) pattern and match object
methods.  Closes buglet #115845.
2000-10-03 20:43:34 +00:00
Thomas Wouters 12e1595e28 Clarify that isatty is only guaranteed to return true for slave ends of
terminals, not the master end (though it does, on most systems.)
2000-10-03 16:54:24 +00:00
Fredrik Lundh 65d4bc616a Fixed negative lookahead/lookbehind. Closes bug #115618. 2000-10-03 16:29:23 +00:00
Fred Drake 0422e7f815 Remove comment about -lucb for the mmap module -- the module has been
changed so that this is no longer needed on the only platform this is
known to have been needed on.

Fixed on indentation-related consistency nit.
2000-10-02 21:20:22 +00:00
Guido van Rossum 1ea64ea3ab Supporting rl_library_version is more trouble than it's worth --
readline doesn't have it before readline 2.2 and there's no
compile-time way to find out which readline version is in use.

Sigh.  GNU readline sucks.
2000-10-02 15:53:08 +00:00
Fred Drake 145f96eb36 my_getpagesize(): New function; returns the size of a page of memory.
Versions are defined for Windows and Unix; the Unix
                   flavor uses sysconf() to get the page size; this avoids
                   the use of getpagesize(), which is deprecated and
                   requires an additional library on some platforms
                   (specifically, Reliant UNIX).

This partially closes SourceForge bug #113797.
2000-10-01 17:50:46 +00:00
Marc-André Lemburg ff50ad53a9 Fix header file usage so that NULL is defined. NULL is needed by
unicodedata_db.h.
2000-09-30 17:34:31 +00:00
Fred Drake a77254a724 PyModule_AddStringConstant(): Make this static since it isn't used
elsewhere in 1.5.2.
2000-09-29 19:23:29 +00:00
Martin v. Löwis c0718eba21 Remove unused VERSION #define.
Add PyModule_AddStringConstant and PyModule_AddObject if version <2.0,
to allow to share this file with PyXML.
2000-09-29 19:05:48 +00:00
Andrew M. Kuchling 36d97ebd58 Add #ifdef's for platforms that don't have the constants POLLRDNORM and
friends.  (Modified version of patch #101682 from Neil Schemenauer)
2000-09-28 21:33:44 +00:00
Fred Drake b64c2239b0 Minor ANSIfication: lib_python no longer needs to be initialized
dynamically to support K&R C since we are requiring an ANSI compiler.
2000-09-28 14:32:29 +00:00
Fred Drake a6debecce5 Fix includes; not including Python.h caused the module not to compile on
some platforms.

This *should* close SourceForge patch #115506.
2000-09-28 02:54:51 +00:00
Jeremy Hylton 6372fe1e40 Fix buffer overflow vulnerabilities in calculate_path(). Code used
copied strings from environment variables and argv[0] into
fixed-length buffers without checking their length.

Reported by Stan Bubrouski; advice on fix from John Viega.
2000-09-27 20:51:17 +00:00
Fred Drake d5fadf75e4 Rationalize use of limits.h, moving the inclusion to Python.h.
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.

This closes SourceForge patch #101659 and bug #115323.
2000-09-26 05:46:01 +00:00
Jeremy Hylton 7198ba986d fix bug #114290: when interpreter's argv[0] has a relative path make
it absolute by joining it with getcwd result.  avoid including
    unnecessary ./ in path but do not test for ../ (more complicated)
2000-09-25 17:00:24 +00:00
Guido van Rossum b00adfbd83 Add missing prototypes for the benefit of SunOS 4.1.4 */ 2000-09-25 13:22:00 +00:00
Guido van Rossum 4b36e6bde1 For the benefit of SunOS 4.1.4, define MS_SYNC as 0 when it's
undefined.  ccording to MvL, this is safe: the MS_SYNC flag means that
msync() returns when all I/O operations are scheduled; without it, it
waits until they are complete, which is acceptable behavior.
2000-09-25 13:16:15 +00:00
Fredrik Lundh cfcea49218 unicode database compression, step 2:
- fixed attributions
- moved decomposition data to a separate table, in preparation
  for step 3 (which won't happen before 2.0 final, promise!)
- use relative paths in the generator script

I have a lot more stuff in the works for 2.1, but let's leave
that for another day...
2000-09-25 08:07:06 +00:00
Tim Peters 51dc968b0b Repaired damaged string. 2000-09-24 22:12:45 +00:00
Fred Drake 28adf52b06 xmlparse_ExternalEntityParserCreate(): Add required cast to return to
avoid compiler warnings.
2000-09-24 22:07:59 +00:00
Fredrik Lundh a4287c29b3 unicode database compression, step 1:
- use unidb compression for the unicodedata module.  on Windows,
  the new unidatabase module is 120k, down from nearly 600k.
2000-09-24 21:45:34 +00:00
Fredrik Lundh eedb5764a5 unicode database compression, step 1:
- use unidb compression for the unicodedata module.  on Windows,
  the new unidatabase module is 120k, down from nearly 600k.
2000-09-24 21:28:28 +00:00
Lars Gustäbel 4a30a07186 Added ExternalEntityParserCreate method (patch 101635). 2000-09-24 20:50:52 +00:00
Fred Drake 93adb6918c Change the name of the exception from "pyexpat.error" to
"xml.parsers.expat.error", so it will reflect the public name of the
exception rather than the internal name.

Also change some of the initialization to use the new PyModule_Add*()
convenience functions.
2000-09-23 04:55:48 +00:00
Neil Schemenauer 7760cff294 Fix some long/"l" int/"i" mismatches. Fixes bug #113779. 2000-09-22 22:35:36 +00:00
Guido van Rossum 7f58e2ec76 It's better to test for __hpux rather than __hppa, and hpux or hppa is
unnecessary.  Sez edg@SF
2000-09-22 17:26:14 +00:00
Guido van Rossum ecc23b07a9 Hopefully fix the problem with undeclared fdatasync() on HP-UX that
was reported twice so far.

Someone with access to HP-UX, please test this!  (Is '__hppa' or
'hppa' really the correct symbol to test for?)
2000-09-22 16:01:05 +00:00
Guido van Rossum ff555e383d Address Bug #115057: add a --with-suffix option to set the EXE
variable in the Makefiles from the configure script.  Usefil for
Cygwin and Mac OS X builds.
2000-09-22 15:38:21 +00:00
Neil Schemenauer 544de1effb - Add DEBUG_SAVEALL option. When enabled all garbage objects found by the
collector will be saved in gc.garbage.  This is useful for debugging a
  program that creates reference cycles.

- Fix else statements in gcmodule.c to conform to Python coding standards.
2000-09-22 15:22:38 +00:00
Fred Drake 676940b497 When PyInt_FromLong() returns NULL, you do not need to check
PyErr_Occurred().  Removed the extra test and setting of a
bogus exception.
2000-09-22 15:21:31 +00:00
Tim Peters f58a7aafea Implemented new os.startfile function, unique to Windows, exposing a
subset of Win32 ShellExecute's functionality.  Guido wants this because
IDLE's Help -> Docs function currently crashes his machine because of a
conflict between his version of Norton AntiVirus (6.10.20) and MS's
_popen.  Docs for startfile are being mailed to Fred (or just read the
docstring -- it tells the whole story).
Changed webbrowser.py to use os.startfile instead of os.popen on Windows.
Changed IDLE's EditorWindow.py to pass an absolute path for the docs
(hardcoding ShellExecute's "directory" arg to "." as used to be done let
IDLE work, but made the startfile command exceedingly obscure for other
uses -- the MS docs are terrible, of course, & still not sure I
understand it).
Note that Windows Python must link with shell32.lib now!  That's where
ShellExecute lives.
2000-09-22 10:05:54 +00:00
Tim Peters 954eef7e51 Fix for SF bug 115051: Dodgy use of PyTuple_SET_ITEM in pyexpat.c 2000-09-22 06:01:11 +00:00
Fred Drake 0f6dcb3f9e Remove debugging print. ;( 2000-09-22 04:49:50 +00:00
Marc-André Lemburg b425f5e35b Added a true unicode_internal_encode function and fixed the
unicode_internal_decode function to support Unicode objects
directly rather than by generating a copy of the object.
2000-09-21 21:09:45 +00:00
Fred Drake ca1f426080 Remove memory leaks of strings/Unicode objects passed into the character
data and default handlers -- a new reference was being passed to
Py_BuildValue() for the "O" format character; using "N" plugs the leak.

Fixed two other (minor) leaks that occurred on various error conditions.

Removed uses of the UNLESS macro, which makes code hard to read, and is
Evil.
2000-09-21 20:10:23 +00:00
Fredrik Lundh 5644b7fad1 - fixed yet another gcc -pedantic warning
- added experimental "expand" method to match objects
- don't use the buffer interface on unicode strings
2000-09-21 17:03:25 +00:00
Guido van Rossum cf06571a8b Use PyOS_setsig() instead of signal(). Also remove redundant spaces
from the FreeBSD code.
2000-09-21 14:32:04 +00:00
Guido van Rossum 6c0f33f8ef Add a definition of rl_library_version. Reported by jpettit@sourceforge. 2000-09-20 20:24:21 +00:00
Guido van Rossum 4622e146ee Randall Hopper: Add fpectl functionality patch for FreeBSD. 2000-09-19 13:35:40 +00:00
Martin v. Löwis c912a3a8fd Implement readlines function. Closes Bug #110686. 2000-09-19 11:06:46 +00:00
Guido van Rossum 9e8181b809 Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.

Changes include:

- There's a --with-pth configure option.

- Instead of _GNU_PTH, we test for HAVE_PTH.

- Better signal handling.

- (The config.h.in file is regenerated in a slightly different order.)
2000-09-19 00:46:46 +00:00
Fred Drake ea4d3f0804 Add invert() and __invert__() as aliases for inv()/__inv__().
Add contains() as alias for __contains__().
Make PyArg_ParseTuple() formats include the function name.

Based on patch by Denis S. Otkidach <ods@users.sourceforge.net>,
this closes SourceForge patch #101390.
2000-09-17 16:09:27 +00:00
Tim Peters 077a11dd00 arraymodule: Fix SF bug 113960.
reverse() didn't work at all due to bad arg check.
    Fixed that.
    Added Brad Chapman to ACKS file, as the proud new owner of two
        implicitly copyrighted lines of Python source code <wink>.
    Repaired buffer_info's total lack of arg-checking.
    Replaced memmove by memcpy in reverse() guts, as memmove is
        often slower and the memory areas are guaranteed disjoint.
    Replaced poke-and-hope unchecked decl of tmp buffer size by
        assert-checked larger tmp buffer.
    Got rid of inconsistent spaces before open paren in docstrings.
    Added reverse() sanity tests to test_array.py.
2000-09-16 22:31:29 +00:00
Guido van Rossum 174efc9cdb Use PyOS_setsig() instead of directly calling signal() or sigaction().
This fixes the first half of bug #110611: the immediate exit when ^C
is hit when readline and threads are configured.

Also added a new module variable, readline.library_version.
2000-09-16 16:37:53 +00:00
Guido van Rossum d2cd7adf6f Use typedef PyOS_sighandler_t and APIs PyOS_getsig() and
PyOS_setsig(), instead of directly calling signal() or sigaction().

This fixes the second half of bug #110611: the mysterious ignoring of
the first ^C when readline isn't used.
2000-09-16 16:35:28 +00:00
Tim Peters 78fc0b57df Fixed legit gripe from c.l.py that math.fmod docs aren't confusing enough.
FRED, please check my monkey-see-monkey-do Tex fiddling!
2000-09-16 03:54:24 +00:00
Fred Drake 1ac526d7cc Add a constant "library" to the module which names the library used,
based on the available headers.

Update comments on the filename extensions used to reflect library
differences.

Added get() and setdefault() methods to the dbm object.

Added docstrings, convert all methods to PyArg_ParseTuple() so that
error messages will have the method names.
2000-09-15 21:35:14 +00:00
Fred Drake e64572bccb Some systems need -lucb to compile the mmap module. Add a comment to
this effect.

This address one aspect of SourceForge bug #113797.
2000-09-15 18:55:58 +00:00
Barry Warsaw 3b2aedbdc5 Py_Main(), usage(), usage_mid: Add -h and -V flags to print the usage
message and Python version number and exit immediately.  Closes patch
#101496.
2000-09-15 18:40:42 +00:00
Martin v. Löwis 2af72d5d6d Use symbolic constants for allowable short ranges. 2000-09-15 08:10:33 +00:00
Tim Peters 0bb44a4a3a Closes SF bug 113894: on Windows, things like os.listdir("k:") and
glob.glob("k:*py") (i.e., a raw drive letter + colon at the start) were
using the root of the drive rather than the expected Windows behavior
of using the drive's "current directory".
2000-09-15 07:44:49 +00:00
Martin v. Löwis 66de5497c5 Check range for bytes and shorts. Closes bug #110845. 2000-09-15 07:31:57 +00:00
Fred Drake ae90f8da24 Trent Mick points out that the BSD DB also provides an ndbm compatibility
layer.  If that is available, consider that as an option as well.
2000-09-15 03:38:12 +00:00
Fred Drake d94f70716e Use the configure support to determine which ndbm.h header to include. 2000-09-14 15:48:06 +00:00
Martin v. Löwis df23f33f9b Add several dl.RTLD_ constants. Closes bug 110842. 2000-09-13 16:26:10 +00:00
Fred Drake 0ac9b07963 Simplify some of the code. Use PyErr_Format() instead of sprintf(), etc.
Reduces lines of code and compiled object size.
2000-09-12 21:58:06 +00:00
Tim Peters bb307343e4 General cleanup in preparation for a bugfix: removed unused code, useless
declarations, added some comments where I had to think too hard to
understand what was happening, and changed the primary internal get/set
functions to assert they're passed objects of the correct type instead of
doing runtime tests for that (it's an internal error that "should never
happen", so it's good enough to check it only in the debug build).
2000-09-10 05:22:54 +00:00
Skip Montanaro ed33c9af97 autodetect presence of libdb - this allows bsddbmodule to be built
automatically if dbopen is found in libc or libdb.  This closes patch
#101420
2000-09-08 02:17:15 +00:00
Guido van Rossum ebba420285 Oops. Jim's fix didn't. This one does -- I tested it a bit better
this time!
2000-09-07 14:35:37 +00:00
Guido van Rossum c84d8bd7be Simple fix from Jin Fulton to avoid returning a half-initialized
module when e.g. copy_reg.py doesn't exist.  This caused a core dump.

This closes SF bug 112944.
2000-09-07 00:11:40 +00:00
Jeremy Hylton 3263dc2b15 compromise value for threshold0: not too high, not too low 2000-09-05 15:44:50 +00:00
Guido van Rossum a22865ec44 Instead of printing all 9 lines of copyright info, print
"Type \"copyright\", \"credits\" or \"license\" for more information."
2000-09-05 04:41:18 +00:00
Fredrik Lundh 510c97ba2f return -1 for undefined groups (as implemented in 1.5.2) instead of
None (as documented) from start/end/span.  closes bug #113254
2000-09-02 16:36:57 +00:00
Guido van Rossum 8586991099 REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Guido van Rossum 38d45b7da9 The second argument to start_new_thread() is not a tuple, as pointed
out by Curtis Jensen on c.l.py and forwarded by Fredrik Lundh.
2000-09-01 20:47:58 +00:00
Tim Peters 9acdd3aed8 Repaired damaged comments, and extra spaces in fatal error msgs we'd better
not ever see!
2000-09-01 19:26:36 +00:00
Guido van Rossum 7c55404207 Move the Py_DECREF(x) after the error: label so that we don't leak x
when PyDict_SetItemString() fails.
2000-09-01 15:35:12 +00:00
Barry Warsaw 9bfd2bf5ed Do the absolute minimal amount of modifications to eradicate
Py_FatalError() from module initialization functions.  The importing
mechanism already checks for PyErr_Occurred() after module importation
and it Does The Right Thing.

Unfortunately, the following either were not compiled or tested by the
regression suite, due to issues with my development platform:

	almodule.c
	cdmodule.c
	mpzmodule.c
	puremodule.c
	timingmodule.c
2000-09-01 09:01:32 +00:00
Tim Peters 736aa32a39 Fix test_popen2 on Windows, recently broken by changes to the dict(!)
implementation.  You don't want to know.  I've asked Guido to give this
a critical review (we agreed on the approach, but the implementation
proved more ... interesting ... than anticipated).  This will almost
certainly be the highlight of Mark Hammond's day <wink>.
2000-09-01 06:51:24 +00:00
Jeremy Hylton 045946d4ee set the default threshold much higher
we don't need to run gc frequently
2000-09-01 04:01:55 +00:00
Jeremy Hylton 51ee09b995 Don't call Py_FatalError in module initialization
(leaving the rest of the modules for Barry)
2000-09-01 03:46:16 +00:00
Jeremy Hylton b709df3810 refactor __del__ exception handler into PyErr_WriteUnraisable
add sanity check to gc: if an exception occurs during GC, call
PyErr_WriteUnraisable and then call Py_FatalEror.
2000-09-01 02:47:25 +00:00
Guido van Rossum b9ce5ada37 Add three prototypes for functions in history.h to shut up gcc -Wall. 2000-09-01 02:43:38 +00:00
Guido van Rossum b92b62771e Moodules -> Modules. 2000-09-01 02:40:11 +00:00
Fred Drake 6cfdffb2e5 Minor adjustment to Setup.in message, based on comment from Barry Warsaw. 2000-08-31 21:53:03 +00:00
Jeremy Hylton a3895c0d29 This module has a poor name, since it can be used under FreeBSD and
Linux.  Perhaps winaudio would be better, as it would offend both
parties equally.

tg@freebsd.org: allow this module to compile under FreeBSD
(he suggests voxwareaudio)
2000-08-31 18:11:07 +00:00
Fred Drake a54436fbdb If Setup is older than Setup.in, issue a bold warning that the Setup may
need to be checked to make sure all the latest information is present.

This closes SourceForge patch #101275.
2000-08-31 16:56:15 +00:00
Fred Drake c9cb84703b Skip Montanaro <skip@mojam.com>:
Update the build structures to automatically detect the presence of BSD db,
including the proper name of the header file to include.  Has all the
expected niceties associated with yet-more-configure-options.  ;)

This checkin includes changes for non-generated files only; subsequent
checkin will catch those.

This is part of SourceForge patch #101272.
2000-08-31 16:11:07 +00:00
Jeremy Hylton 0625777b53 apply patch #101362 by Vladimir Marangozov
also initial static debug variable to 0
2000-08-31 15:10:24 +00:00
Fred Drake 8ce159aef5 Peter Schneider-Kamp <nowonder@nowonder.de>:
Remove some of GCC's warning in -Wstrict-prototypes mode.

This closes SourceForge patch #101342.
2000-08-31 05:18:54 +00:00
Fred Drake c818d5347e Remove one compiler warning found with -Wstrict-prototypes. 2000-08-31 05:07:19 +00:00
Fredrik Lundh e67d8e514f oops. accidentally reintroduced a memory leak. put the bugfix back. 2000-08-27 21:32:46 +00:00
Fredrik Lundh 33accc1f5c don't mistake memory errors (including reaching the recursion limit)
with success.  also, check return values from the mark functions.

this addresses (but doesn't really solve) bug #112693, and low-memory
problems reported by jack jansen.
2000-08-27 20:59:47 +00:00
Guido van Rossum 0df002c45b Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),
PyRun_FileEx().  These are the same as their non-Ex counterparts but
have an extra argument, a flag telling them to close the file when
done.

Then this is used by Py_Main() and execfile() to close the file after
it is parsed but before it is executed.

Adding APIs seems strange given the feature freeze but it's the only
way I see to close the bug report without incompatible changes.

[ Bug #110616 ] source file stays open after parsing is done (PR#209)
2000-08-27 19:21:52 +00:00
Guido van Rossum fee3a2dd8c Charles Waldman's patch to reinitialize the interpreter lock after a
fork.  This solves the test_fork1 problem.  (ceval.c, signalmodule.c,
intrcheck.c)

SourceForge: [ Patch #101226 ] make threading fork-safe
2000-08-27 17:34:07 +00:00
Thomas Wouters 124af7cfd6 Fixed this problem. 2000-08-26 11:34:29 +00:00
Tim Peters 6d7c442e03 Try to supply a prototype for the module init function but avoid
Windows "inconsistent linkage" warnings at the same time.  I agree
with Mark Hammond that the whole DL_IMPORT/DL_EXPORT macro system
needs an overhaul; this is just an expedient hack until then.
2000-08-26 07:38:06 +00:00
Fred Drake 28f739aad4 Update the parser module to support augmented assignment.
Add some test cases.
2000-08-25 22:42:40 +00:00
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
Andrew M. Kuchling a4e9a33382 Update e-mail address 2000-08-01 01:26:02 +00:00
Peter Schneider-Kamp dc71cacc9c replaced PyArgs_Parse by PyArgs_ParseTuple
changed error messages for extend method from "append" to "extend"
2000-07-31 21:57:30 +00:00
Peter Schneider-Kamp 5a65c2d436 added count, extend, index, pop and remove to arraymodule 2000-07-31 20:52:21 +00:00
Peter Schneider-Kamp 7e01890986 merge Include/my*.h into Include/pyport.h
marked my*.h as obsolete
2000-07-31 15:28:04 +00:00
Mark Hammond 071864acb2 More Windows changes.
* After discussion with Trent, all INT_PTR references have been removed in favour of the HANDLE it should always have been.  Trent can see no 64bit issues here.

* In this process, I noticed that the close operation was dangerous, in that we could end up passing bogus results to the Win32 API.  These result of the API functions passed the bogus values were never (and still are not) checked, but this is closer to "the right thing" (tm) than before.

Tested on Windows and Linux.
2000-07-30 02:46:26 +00:00
Mark Hammond 2cbed005b6 Fixes for Windows (but also tested on Linux). Test suite now completes, and this module should not leak in the face of errors.
Checkin that replaces the INT_PTR types with HANDLEs still TBD (but as that is a "spelling" patch, rather than a functional one, I will commit it seperately.
2000-07-30 02:22:43 +00:00
Andrew M. Kuchling fb6bbf51a6 Added list of missing functions as a comment 2000-07-27 11:58:01 +00:00
Andrew M. Kuchling 8353f623d6 Comment out a debugging print (spotted by Michael Deegan) 2000-07-26 18:36:27 +00:00
Fredrik Lundh 2031893842 - changed windows pclose to make sure we don't return before the
underlying process has terminated
  (bug fix from David Bolen)
2000-07-26 17:29:12 +00:00
Jeremy Hylton 4d6381dfee Fix UCNs machine with >= 32bit longs
originally submitted by Bill Tutt

Note: This code is actually going to be replaced in 2.0 by /F's new
database.  Until then, this patch keeps the test suite working.
2000-07-26 03:56:06 +00:00
Andrew M. Kuchling 70e89c11fe Added wrappers for tiget{flag,num,str}, for querying terminfo capabilities 2000-07-26 02:57:20 +00:00
Thomas Wouters 334fb8985b Use 'void' directly instead of the ANY #define, now that all code is ANSI C.
Leave the actual #define in for API compatibility.
2000-07-25 12:56:38 +00:00
Andrew M. Kuchling bf680266da Modified version of patch #100963 from Mark Favas: has_key() is an
ncurses extension, so it's made conditional depending on STRICT_SYSV_CURSES
2000-07-25 12:37:41 +00:00
Andrew M. Kuchling 4463acbc32 Bug report and partial patch from Michael Deegan <michael@ucc.gu.uwa.edu.au>:
reversed tests resulted in an exception when you supplied the correct number
of arguments
2000-07-24 23:54:49 +00:00
Thomas Wouters c44221271a Remove unused variable and what looks like an ancient relic of an old
version of SSLeay (now known as OpenSSL.)
2000-07-24 16:26:35 +00:00
Thomas Wouters 1e0c2f4bee Create a new section of pyport.h to hold all external function declarations
for systems that are missing those declarations from system include files.
Start by moving a pointy-haired ones from their previous locations to the
new section.

(The gethostname() one, for instance, breaks on several systems, because
some define it as (char *, size_t) and some as (char *, int).)

I purposely decided not to include the summary of used #defines like Tim did
in the first section of pyport.h. In my opinion, the number of #defines
likedly to be used by this section would make such an overview unwieldy. I
would suggest documenting the non-obvious ones, though.
2000-07-24 16:06:23 +00:00
Thomas Wouters 5c669860e6 ANSIfy a bit more. 2000-07-24 15:49:08 +00:00
Thomas Wouters ed77bac472 Fix floattime prototype ((void), not (double)) 2000-07-24 15:26:39 +00:00
Thomas Wouters 58d0510245 ANSIfy some more forward declarations. 2000-07-24 14:43:35 +00:00
Thomas Wouters 4789b3ae05 ... and yet more ANSIfications... 2000-07-24 11:36:47 +00:00
Thomas Wouters 770e4042db ANSIfy yet another hidden function definition. 2000-07-24 11:26:25 +00:00
Thomas Wouters eb61b6ebb6 Fix typo in previous patch. 2000-07-24 11:17:40 +00:00
Thomas Wouters ccada2421b *** empty log message *** 2000-07-24 11:09:37 +00:00
Mark Hammond 46a733dfbf Patch #100926 - Better error messages for socket exceptions on Windows. [Slight style differences from posted patch] 2000-07-24 01:45:11 +00:00
Fredrik Lundh 8a3ebf8ca8 -- SRE 0.9.6 sync. this includes:
+ added "regs" attribute
 + fixed "pos" and "endpos" attributes
 + reset "lastindex" and "lastgroup" in scanner methods
 + removed (?P#id) syntax; the "lastindex" and "lastgroup"
   attributes are now always set
 + removed string module dependencies in sre_parse
 + better debugging support in sre_parse
 + various tweaks to build under 1.5.2
2000-07-23 21:46:17 +00:00
Tim Peters 4f1b2081e9 Removed all instances of RETSIGTYPE from the source code: signal
handlers "return void", according to ANSI C.
Removed the new Py_RETURN_FROM_SIGNAL_HANDLER macro.
Left RETSIGTYPE in the config stuff, because it's not clear to
me that others aren't relying on it (e.g., extension modules).
2000-07-23 21:18:09 +00:00
Fredrik Lundh 56055a4749 -- added code to the new Windows popen functions to make close
return the exit code.  Only works on Windows NT/2000, due to
   limitations in the Win9X shell.
   (based on patch #100941 by David Bolen)
2000-07-23 19:47:12 +00:00
Tim Peters e21107145a Missed a return from a signal handler -- thanks to /F for pointing
it out!
2000-07-23 18:33:52 +00:00
Tim Peters 1be46844d9 Recent ANSIfication introduced a couple instances of
#if RETSIGTYPE != void
That isn't C, and MSVC properly refuses to compile it.
Introduced new Py_RETURN_FROM_SIGNAL_HANDLER macro in pyport.h
to expand to the correct thing based on RETSIGTYPE.  However,
only void is ANSI!  Do we still have platforms that return int?
The Unix config mess appears to #define RETSIGTYPE by magic
without being asked to, so I assume it's "a problem" across
Unices still.
2000-07-23 18:10:18 +00:00
Thomas Wouters 53e7fd77a7 Fix prototypes generated by makesetup, so they include '(void)' rather than
empty argumentlists.
2000-07-23 00:02:15 +00:00
Thomas Wouters bd4bc4e9e9 Even more ANSIfication: fix as many function pointers and declarations as
possible.
2000-07-22 23:57:55 +00:00
Thomas Wouters 3b6448fbae ANSIfication: add proper prototypes to function-pointers and declarations.
Also, fix a bug found by said declarations, where a string was defined as
unsigned char*, but used as signed.
2000-07-22 23:56:07 +00:00
Thomas Wouters 2c46eaf8e9 ANSIfication of function-pointers and declarations. Also, make sure to
return something if RETSIGTYPE is not void, in functions that are defined as
returning RETSIGTYPE.
2000-07-22 23:51:19 +00:00
Thomas Wouters 0796b00279 Further ANSIfication of functionpointers and declarations. Also, make sure
to return something if RETSIGTYPE isn't void, in functions that are defined
to return RETSIGTYPE. Work around an argumentlist mismatch ('void' vs.
'void *') by using a static wrapper function.
2000-07-22 23:49:30 +00:00
Thomas Wouters ba48a3f3ff Remove unused variable. 2000-07-22 16:41:08 +00:00
Thomas Wouters 1bc8c1eb83 Remove unused helper-function 'posix_strint'. 2000-07-22 16:39:39 +00:00
Thomas Wouters 3531730a68 Mark Favas's fix for typos in docstrings. 2000-07-22 16:34:15 +00:00
Thomas Wouters f3f33dcf03 Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
and a couple of functions that were missed in the previous batches. Not
terribly tested, but very carefully scrutinized, three times.

All these were found by the little findkrc.py that I posted to python-dev,
which means there might be more lurking. Cases such as this:

long
func(a, b)
	long a;
	long b; /* flagword */
{

and other cases where the last ; in the argument list isn't followed by a
newline and an opening curly bracket. Regexps to catch all are welcome, of
course ;)
2000-07-21 06:00:07 +00:00
Skip Montanaro 49bd24d4e4 added history file truncation based upon code from Johannes Zellner. 2000-07-19 16:54:53 +00:00
Thomas Wouters 616607a987 ANSIfy the just-checked-in isatty() wrapper. 2000-07-19 14:45:40 +00:00
Skip Montanaro 1517d842b6 new method isatty from Thomas Wouters 2000-07-19 14:34:14 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Jack Jansen 307d7a426f Implemented getdefaultlocale() for macintosh, after an idea by Fredrik. 2000-07-15 22:31:45 +00:00
Thomas Wouters 70c21a1603 Move (actually copy) support for the sgi._getpty() function into
posix.openpty(). And conveniently also check if CVS write access really
works.

Closes SF patch #100722
2000-07-14 14:28:33 +00:00
Andrew M. Kuchling 9f28a039f6 Use PyObject_AsFileDescriptor 2000-07-13 23:59:35 +00:00
Peter Schneider-Kamp 9656abd913 ANSI-fication (got lost in the deep seas of source forge <wink>) 2000-07-13 21:10:57 +00:00
Andrew M. Kuchling 8d2f2b2db2 From Sam Rushing's Medusa, via SF patch #100858: add & document
os.seteuid(), os.setegid(), os.setreuid(), os.setregid().
2000-07-13 01:26:58 +00:00
Jeremy Hylton 03657cfdb0 replace PyXXX_Length calls with PyXXX_Size calls 2000-07-12 13:05:33 +00:00
Guido van Rossum 3f2fa0a53d Add "exceptions" to list of built-in modules for the sake of
sys.builtin_module_names.  (Noticed by Toby Dickenson.)
2000-07-12 12:09:05 +00:00
Sjoerd Mullender 0ae528447f Fixed up some ANSIfications. 2000-07-12 10:43:11 +00:00
Barry Warsaw 35e459c3eb debug_instance(): Use the same %p format directive as with
debug_cycle(), and don't cast the pointer to a long.  Neither needs
the literal `0x' prefix as %p automatically inserts this (on Linux at
least).
2000-07-12 05:18:36 +00:00
Fred Drake 0582df98d3 Convert coding style to be internally consistent and similar to the
rest of the Python C code: space between "if", "for" and "(", no space
between "(", ")" and function call parameters, etc.
2000-07-12 04:49:00 +00:00
Fred Drake cc1be2401e Always use the :funcname part of the format specifier for PyArg_ParseTuple()
so we get better error messages.
2000-07-12 04:42:23 +00:00
Andrew M. Kuchling c72c3bed77 Fix bugs in readinst():
* There was no error reported if the .read() method returns a non-string
* If read() returned too much data, the buffer would be overflowed causing a
  core dump
* Used strncpy, not memcpy, which seems incorrect if there are embedded \0s.
* The args and bytes objects were leaked
2000-07-12 01:27:18 +00:00
Andrew M. Kuchling a4e75d74f8 Patch #100854 from jhylton: eliminate compiler warnings in pyexpat:
The first two warnings seem harmless enough,
	but the last one looks like a potential bug: an
	uninitialized int is returned on error. (I also
	ended up reformatting some of the code,
	because it was hard to read.)
2000-07-12 00:53:41 +00:00
Vladimir Marangozov 9e3d73af93 Fix mixed mallocs: re->re_patbuf.buffer is allocated with std malloc(). 2000-07-12 00:49:17 +00:00
Peter Schneider-Kamp 618e25dfdf Errare humanum est.
Changed parameter in getsockaddrlen from unsigned to socklen_t.
2000-07-11 23:00:12 +00:00
Jack Jansen e4b4863296 One more include of limits.h (possibly to be moved elsewhere when there is
consensus where it should go).
2000-07-11 21:35:02 +00:00
Jeremy Hylton 672fac0d65 satisfy the -Wall: remove two unused local variables and unused ins function 2000-07-11 20:30:05 +00:00
Peter Schneider-Kamp 88e1932930 fixed a warning in getsockaddrlen 2000-07-11 17:40:30 +00:00
Fred Drake b35de5b78a Neil Schemenauer <nascheme@enme.ucalgary.ca>:
Change a cast, intialize a local, and make some sprintf() format strings
type-appropriate (add the "l" to "%d").

Closes SourceForge patch #100737.
2000-07-11 14:37:41 +00:00
Tim Peters dc0c031ad8 Now that prototypes are in scope, the compiler gives legit wngs
about int size mismatches at two calls to s_rand.  Stuffed in
casts to make the code do what it did before but w/o warnings --
although unclear that's correct!
2000-07-10 22:41:30 +00:00
Peter Schneider-Kamp 3e3175b5e7 ANSI-fication (fixed on parameter list I messed up in the patch) 2000-07-10 17:25:37 +00:00
Peter Schneider-Kamp 8bc8f0d036 ANSI-fication 2000-07-10 17:15:07 +00:00
Peter Schneider-Kamp 3646366f4c ANSI-fication, added #ifdef construction in mpz_coerce 2000-07-10 17:14:00 +00:00
Peter Schneider-Kamp cb27c35aa6 ANSI-fication, not really tested, but should (hopefully) compile 2000-07-10 17:06:38 +00:00
Peter Schneider-Kamp 6a85027a97 ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
have already been checked in)

UNTESTED!
2000-07-10 17:04:33 +00:00
Fredrik Lundh 10723347c6 - stupid typo. 2000-07-10 16:38:09 +00:00
Fredrik Lundh 44328e60df -- get rid of a compiler warning on unix. (as reported
for #100836, but implemented in a different way)
2000-07-10 15:59:30 +00:00
Peter Schneider-Kamp 39e0e5a180 ANSI-fication 2000-07-10 13:12:27 +00:00
Peter Schneider-Kamp 7d0c71ac8c ANSI-fication 2000-07-10 13:05:29 +00:00
Peter Schneider-Kamp 286da3b46a ANSI-fying
added excplicit node * parameter to termvalid argument in
validate_two_chain_ops of parsermodule.c (as proposed by fred)
2000-07-10 12:43:58 +00:00
Peter Schneider-Kamp 41c36ffe83 ANSI-fication 2000-07-10 12:29:26 +00:00
Peter Schneider-Kamp 416d413527 ANSI-fication 2000-07-10 12:15:54 +00:00
Peter Schneider-Kamp e89b15691e ANSI-fication 2000-07-10 12:04:18 +00:00
Peter Schneider-Kamp c4bc0e0895 ANSI-fication 2000-07-10 11:56:03 +00:00
Peter Schneider-Kamp 0659b4af46 ANSI-fication 2000-07-10 10:49:30 +00:00
Peter Schneider-Kamp 3707efef9b ANSI-fication 2000-07-10 10:03:58 +00:00
Peter Schneider-Kamp a788a7f0fb ANSI-fication 2000-07-10 09:57:19 +00:00
Peter Schneider-Kamp fe74263cec ANSI-fication 2000-07-10 09:55:32 +00:00
Peter Schneider-Kamp 8235f1c834 ANSI-fication 2000-07-10 09:43:24 +00:00
Peter Schneider-Kamp f1ca898d85 ANSI-fication 2000-07-10 09:31:34 +00:00
Peter Schneider-Kamp faaad372ec ANSI-fication (and test if committing files works now) 2000-07-10 09:26:41 +00:00
Vladimir Marangozov b16714b4d0 Initialize the return value in collect_generations() since it is updated
conditionally in the code.
2000-07-10 05:37:39 +00:00
Fred Drake 859bad00cb Guido said include these in the Great ANSI-fication, so here they are! 2000-07-10 04:20:57 +00:00
Fredrik Lundh 9ac81f69b2 - changed the nt.popen2 return values back to
(write, read, ...), based on feedback from GvR.

- added tuple-swapping code to popen2.py

- fixed some runaway indentation in posixmodule.c
2000-07-09 23:35:24 +00:00
Fredrik Lundh 620f37723f - changed 1.5 to 2.0 in the help text
(the PYTHONHOMEHELP define)

- ANSI-fication
  (patch #100794 by Peter Schneider-Kamp)
2000-07-09 20:42:34 +00:00
Fredrik Lundh faa209d6bd - ANSI-fication
(patch #100805 by Peter Schneider-Kamp)
2000-07-09 20:35:15 +00:00
Fredrik Lundh bb7eeff44a - added popen.popen2/popen3/popen4 support for
windows.

- added optional mode argument to popen2/popen3
  for unix; if the second argument is an integer,
  it's assumed to be the buffer size.

- changed nt.popen2/popen3/popen4 return values
  to match the popen2 module (stdout first, not
  stdin).
2000-07-09 17:59:32 +00:00
Fredrik Lundh 766ccdcf18 - added optional bufsize argument to new popen methods.
for the moment, this argument must be left out or set
  to -1 (only the default bufsize is supported, that is)
2000-07-09 17:41:01 +00:00
Fredrik Lundh f5accf38ea - ANSI-fication
(patch #100784 by Peter Schneider-Kamp)
2000-07-09 15:14:52 +00:00
Fredrik Lundh 3c5d43d342 - ANSI-ification
(patch #100770 by Peter Schneider-Kamp)
2000-07-09 15:09:56 +00:00
Fredrik Lundh ffb9c770f8 - improved os.popen support for windows, based on win32pipe
by Bill Tutt.

  note: to run this on Windows 95/98, you need to have the
  w9xpopen.exe helper in the same directory as the python DLL.
2000-07-09 14:49:51 +00:00
Fred Drake 3cd2ee4037 Remove use of HAVE_OLD_CPP to support non-ANSI preprocessors. 2000-07-09 14:36:13 +00:00
Andrew M. Kuchling ad9b1f8533 Patch from Peter Schneider-Kamp: convert curses module to ANSI prototypes,
and substitute the conventional "args" instead of "arg".
2000-07-09 14:35:00 +00:00
Fredrik Lundh 5cccf50931 - added (long) casts to a couple of Py_BuildValue calls,
just for the sake of it.

  note that this only covers the unlikely case that size_t
  is smaller than a long; it's probably more likely that
  there are platforms out there where size_t is *larger*
  than a long, and mmapmodule cannot really deal with that
  today.
2000-07-09 13:16:13 +00:00
Fredrik Lundh e25cfd8662 - fixed pointer size test in spawn functions. also added
cast to make sure Py_BuildValue gets the right thing.

  this change eliminates bogus return codes from successful
  spawn calls (e.g. 2167387144924954624 instead of 0).
2000-07-09 13:10:40 +00:00
Tim Peters dbd9ba6a6c Nuke all remaining occurrences of Py_PROTO and Py_FPROTO. 2000-07-09 03:09:57 +00:00
Fredrik Lundh ff7df9d7b8 this one's a bit risky, but I've spent some considerable time
staring at the diffs before checking this one in.  let me know
asap if it breaks things on your platform.

-- ANSI-fying
   (patch #100763 by Peter Schneider-Kamp, minus the
    indentation changes and minus the changes the broke
    the windows build)
2000-07-08 22:48:53 +00:00
Fredrik Lundh 54cf3dc88c -- ANSI-fying, names
(patch #100762 by Peter Schneider-Kamp, minus the
    indentation changes)

-- added INT_PTR workaround to make it build under VC 5.0
2000-07-08 22:05:01 +00:00
Fredrik Lundh 89610a4d50 - _getdefaultlocale shouldn't accept arguments
- some more spacification...
2000-07-08 20:07:24 +00:00
Fredrik Lundh 8f017a01f8 - added _getdefaultlocale implementation for WIN32
- ansified, reindentified, spacified, nullified
2000-07-08 19:57:37 +00:00
Fred Drake 51b6bc55e3 ANSI-fication of the sources, convert to 4-space indents.
Use PyArg_ParseTuple() to get better error messages.
Add docstrings all around.
2000-07-08 16:56:26 +00:00
Fred Drake 2c4a3dceaf ANSI-fied sources, converted to four-space indentation.
Converted to PyArg_ParseTuple() with method names to get better error
messages.
2000-07-08 06:41:03 +00:00
Fred Drake edabdc1e9e ANSI-fied sources, converted to four-space indentation. 2000-07-08 06:16:37 +00:00
Fred Drake da940d8f8d Add method names to PyArg_ParseTuple() calls for better error messages.
Convert to four-space indents.
2000-07-08 06:05:58 +00:00
Fred Drake e3a41c653a ANSI-fy the sources.
Convert to using PyArg_ParseTuple() as appropriate to allow method names
in error messages.
Re-indent to four-space indentation.
2000-07-08 05:00:07 +00:00
Fred Drake 0c89d4ec9a Pretensions of the 20th century... remove old-style preprocessor
hackery (/**/), leaving only new-style preprocessor hackery (##).
2000-07-08 04:53:48 +00:00
Fred Drake 5639ba4896 ANSI-fy the sources. 2000-07-08 04:12:08 +00:00
Fred Drake 509d79adaf Removed Py_PROTO, ANSI-fied sources. 2000-07-08 04:04:38 +00:00
Fred Drake e55d5446ea Thomas Wouters <thomas@xs4all.net>:
Allow -f* parameters to be passed to the compiler from Setup files.
2000-07-07 16:21:31 +00:00
Marc-André Lemburg 71f36983b9 Removed a prototype which is not used in socketmodule.c
Patch by T. Wouters.
2000-07-07 14:13:29 +00:00
Fred Drake 49b0c3bafe Fix bug #392, reported by Jonathan Giddy <jon@dstc.edu.au>:
In posixmodule.c:posix_fork, the function PyOS_AfterFork is called for
both the parent and the child, despite the docs stating that it should
be called in the new (child) process.

This causes problems in the parent since the forking thread becomes the
main thread according to the signal module.

Calling PyOS_AfterFork() only in the child fixes this.  Changed for both
fork() and forkpty().
2000-07-06 19:42:19 +00:00
Fred Drake 589c35bcc7 Python 2.0 is not supposed to use string exceptions in the standard library
& extensions, so create exceptions in extension modules using the
PyErr_NewException() API.
2000-07-06 19:38:49 +00:00
Skip Montanaro 28067821e2 added read_history_file and write_history_file
XXX should perhaps support history truncation as well
2000-07-06 18:55:12 +00:00
Andrew M. Kuchling 1a10400692 Removed unused variables.
Added two functions that were left out of the method definition table.
2000-07-06 18:14:03 +00:00
Skip Montanaro fd022672a0 don't prepend "$(srcdir)/" to paths beginning with "$" since they are likely
to be absolute.
2000-07-06 17:58:06 +00:00
Tim Peters 54925f98d3 Add more "volatile" decls to stop gcc -Wall warnings.
Somebody w/ gcc please check that the wngs are gone!
There are cheaper (at runtime) ways to prevent the wngs, but
they're obscure and delicate.  I'm going for the easy Big
Hammer here under the theory that PCRE will be replaced by
SRE anyway.
2000-07-05 22:56:52 +00:00
Fredrik Lundh 2855290b84 maintenance release:
- reorganized some code to get rid of -Wall and -W4
  warnings

- fixed default argument handling for sub/subn/split
  methods (reported by Peter Schneider-Kamp).
2000-07-05 21:14:16 +00:00
Andrew M. Kuchling da13f89fee Remove definition of _GNU_SOURCE, since Python.h now does it for us 2000-07-05 12:22:14 +00:00
Marc-André Lemburg 5f0e29eb45 Modified the encode interfaces of all builtin codecs to accept
any object which can be converted to Unicode by means of
PyUnicode_FromObject().
2000-07-05 11:24:13 +00:00
Fred Drake 7bd9f41c65 pyexpat.errors is a *strange* module!
It gets initialized when pyexpat is imported, and is only accessible as an
attribute of pyexpat; it cannot be imported itself.  This allows it to at
least be importable after pyexpat itself has been imported by adding it
to sys.modules, so it is not quite as strange.

This arrangement needs to be better thought out.
2000-07-04 23:51:31 +00:00
Fred Drake 7797d3692b Remove warning about local variable possibly being using uninitialized;
noted by Marc-Andre Lemburg <mal@lemburg.com>.
2000-07-04 18:48:46 +00:00
Andrew M. Kuchling 637f6642f2 Fixes for compilation problems on Tru64 reported by Mark Favas 2000-07-04 14:53:43 +00:00
Marc-André Lemburg 8bcfb8a5e0 Fixed symbol search for defining NSIG. It now also checks _NSIG
which some C libs define (e.g. glibc).

Added a fallback default value for NSIG which hopefully provides
enough room for signal slots.
2000-07-04 14:17:33 +00:00
Tim Peters 489d54ef66 Typo repair in docstring -- my fault. 2000-07-03 22:41:34 +00:00
Jack Jansen ee398fa058 Mac only: two epoch problem workarounds are no longer needed for GUSI
>= 2.0.5. One still is:-(
2000-07-03 21:37:27 +00:00
Fredrik Lundh 72b82ba16d - fixed grouping error bug
- changed "group" operator to "groupref"
2000-07-03 21:31:48 +00:00
Fredrik Lundh 6f01398236 - added lookbehind support (?<=pattern), (?<!pattern).
the pattern must have a fixed width.

- got rid of array-module dependencies; the match pro-
  gram is now stored inside the pattern object, rather
  than in an extra string buffer.

- cleaned up a various of potential leaks, api abuses,
  and other minors in the engine module.

- use mal's new isalnum macro, rather than my own work-
  around.

- untabified test_sre.py.  seems like I removed a couple
  of trailing spaces in the process...
2000-07-03 18:44:21 +00:00
Fred Drake 40c48685a2 ANSI-fication, remove Py_PROTO, etc.
Revise math_1(), math_2(), stub-generating macros, and function tables to
use PyArg_ParseTuple() and properly provide the function name for error
message generation.
Fix pow() docstring for MPW 3.1; had said "power" instead of "pow".
2000-07-03 18:11:56 +00:00
Fred Drake 22269b5976 Andrew Kuchling <akuchlin@mems-exchange.org>:
Typo in string literal: execpt --> except
2000-07-03 18:07:43 +00:00
Fredrik Lundh c2301730b8 - experimental: added two new attributes to the match object:
"lastgroup" is the name of the last matched capturing group,
  "lastindex" is the index of the same group.  if no group was
  matched, both attributes are set to None.

  the (?P#) feature will be removed in the next relase.
2000-07-02 22:25:39 +00:00
Tim Peters c9c02c4cf3 Repair docs for math.frexp (they were wrong).
Reported on c.l.py by Kirill Simonov.
2000-07-02 20:17:08 +00:00
Fredrik Lundh 7cafe4d7e4 - actually enabled charset anchors in the engine (still not
used by the code generator)

- changed max repeat value in engine (to match earlier array fix)

- added experimental "which part matched?" mechanism to sre; see
  http://hem.passagen.se/eff/2000_07_01_bot-archive.htm#416954
  or python-dev for details.
2000-07-02 17:33:27 +00:00
Fredrik Lundh 3562f11764 -- use charset bitmaps where appropriate. this gives a 5-10%
speedup for some tests, including the python tokenizer.

-- added support for an optional charset anchor to the engine
   (currently unused by the code generator).

-- removed workaround for array module bug.
2000-07-02 12:00:07 +00:00
Fredrik Lundh c13222cdff - fixed "{ in any other context" bug
- minor comment touchups in the C module
2000-07-01 23:49:14 +00:00
Fredrik Lundh 22d2546520 today's SRE update:
-- changed 1.6 to 2.0 in the file headers

-- fixed ISALNUM macro for the unicode locale.  this
   solution isn't perfect, but the best I can do with
   Python's current unicode database.
2000-07-01 17:50:59 +00:00
Fred Drake 728819af5d Restore strict checking of socket address values; addresses passed to
the bind(), connect(), and connect_ex() methods must be a single
parameter.

Originally part of 1.98, reverted in 1.100.
2000-07-01 03:40:12 +00:00
Guido van Rossum db67739d4f Jack Jansen, Mac patch:
Include limits.h if we have it.
2000-07-01 01:09:43 +00:00
Guido van Rossum ce8e1dc395 clean up warnings in Win32 build of mmapmodule.c 2000-07-01 00:51:51 +00:00
Guido van Rossum 9f754e0e2d In b_setitem(), instead of the platform dependent CHAR_MIN and
CHAR_MAX, use hardcoded -128 and 127.  This may seem strange, unless
you realize that we're talking about signed bytes here!  Bytes are
always 8 bits and 2's complement.  CHAR_MIN and CHAR_MAX are
properties of the char data type, which is guaranteed to hold at least
8 bits anyway.

Otherwise you'd get failing tests on platforms where unsigned char is
the default (e.g. AIX).

Thanks, Vladimir Marangozov, for finding this nit!
2000-07-01 00:38:19 +00:00
Guido van Rossum ef4bb5ffe1 Change copyright notice. 2000-07-01 00:16:13 +00:00
Guido van Rossum ffcc3813d8 Change copyright notice - 2nd try. 2000-06-30 23:58:06 +00:00
Guido van Rossum fd71b9e9d4 Change copyright notice. 2000-06-30 23:50:40 +00:00
Guido van Rossum 276fa43faf Fix another error on AIX by using a proper cast. 2000-06-30 23:04:18 +00:00
Guido van Rossum 64529cd7ce Crude way to fix a problem on AIX: #undef STAT before defining it. 2000-06-30 22:45:12 +00:00
Fredrik Lundh ef34bd2c0d -- changed $ to match before a trailing newline, even
if the multiline flag isn't given.
2000-06-30 21:40:20 +00:00
Barry Warsaw 257543c78d Setup.thread.in was misnamed so it has been replaced by
Setup.config.in.  The latter contains all configure-time selectable
modules; currently thread and gc.
2000-06-30 16:12:15 +00:00
Barry Warsaw 5a06fae399 Add Setup.config 2000-06-30 16:09:01 +00:00
Barry Warsaw 61b49b3d6b Removed the comment about the thread module. 2000-06-30 16:05:22 +00:00
Barry Warsaw 6de7213e7a Setup.thread => Setup.config 2000-06-30 16:04:18 +00:00
Fred Drake a44d353e2b Trent Mick <trentm@activestate.com>:
The common technique for printing out a pointer has been to cast to a long
and use the "%lx" printf modifier. This is incorrect on Win64 where casting
to a long truncates the pointer. The "%p" formatter should be used instead.

The problem as stated by Tim:
> Unfortunately, the C committee refused to define what %p conversion "looks
> like" -- they explicitly allowed it to be implementation-defined. Older
> versions of Microsoft C even stuck a colon in the middle of the address (in
> the days of segment+offset addressing)!

The result is that the hex value of a pointer will maybe/maybe not have a 0x
prepended to it.


Notes on the patch:

There are two main classes of changes:
- in the various repr() functions that print out pointers
- debugging printf's in the various thread_*.h files (these are why the
patch is large)


Closes SourceForge patch #100505.
2000-06-30 15:01:00 +00:00
Fredrik Lundh 0640e1161f the mad patcher strikes again:
-- added pickling support (only works if sre is imported)

-- fixed wordsize problems in engine
   (instead of casting literals down to the character size,
   cast characters up to the literal size (same as the code
   word size).  this prevents false hits when you're matching
   a unicode pattern against an 8-bit string. (unfortunately,
   this broke another test, but I think the test should be
   changed in this case; more on that on python-dev)

-- added sre.purge function
   (unofficial, clears the cache)
2000-06-30 13:55:15 +00:00
Fredrik Lundh 43b3b49b5a - fixed lookahead assertions (#10, #11, #12)
- untabified sre_constants.py
2000-06-30 10:41:31 +00:00
Fredrik Lundh df02d0b3f0 - fixed default value handling in group/groupdict
- added test suite
2000-06-30 07:08:20 +00:00
Jeremy Hylton c5007aa5c3 final patches from Neil Schemenauer for garbage collection 2000-06-30 05:02:53 +00:00
Fred Drake 947121fd9c Add a comment about needing to change a #include if using a version of
Berkeley DB 2.0 or newer; most Linux distros will include a more recent
version than 1.85.
2000-06-30 04:17:11 +00:00
Fred Drake a04eaad5c7 Trent Mick <trentm@activestate.com>:
This patch fixes possible overflows in the socket module for 64-bit
platforms (mainly Win64). The changes are:

- abstract the socket type to SOCKET_T (this is SOCKET on Windows, int
on Un*x), this is necessary because sizeof(SOCKET) > sizeof(int) on
Win64

- use INVALID_SOCKET on Win32/64 for an error return value for
accept()

- ensure no overflow of the socket variable for: (1) a PyObject return
value (use PyLong_FromLongLong if necessary); and (2) printf
formatting in repr().

Closes SourceForge patch #100516.
2000-06-30 02:46:07 +00:00
Guido van Rossum f385c5e544 Patch by Nadav Horesh to make acosh and asinh better.
Tim posted a long comment to python-dev (subject: "Controversial patch
(cmath)"; date: 6/29/00).  The conclusion is that this whole module
stinks and this patch isn't perfect, but it's better than the acosh
and asinh we had, so let's check it in.
2000-06-30 02:29:22 +00:00
Fredrik Lundh 01016fe972 - fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags

- fixed group/octal code parsing in sub/subn templates
2000-06-30 00:27:46 +00:00
Fredrik Lundh 29c08beab0 still trying to figure out how to fix the remaining
group reset problem.  in the meantime, I added some
optimizations:

- added "inline" directive to LOCAL

  (this assumes that AC_C_INLINE does what it's
  supposed to do).  to compile SRE on a non-unix
  platform that doesn't support inline, you have
  to add a "#define inline" somewhere...

- added code to generate a SRE_OP_INFO primitive

- added code to do fast prefix search

  (enabled by the USE_FAST_SEARCH define; default
  is on, in this release)
2000-06-29 23:33:12 +00:00
Fred Drake 0e12395190 Trent Mick <trentm@activestate.com>:
This patch fixes a possible overflow in the Sleep system call on
Win32/64 in the time_sleep() function in the time module. For very
large values of the give time to sleep the number of milliseconds can
overflow and give unexpected sleep intervals. THis patch raises an
OverflowError if the value overflows.

Closes SourceForge patch #100514.
2000-06-29 21:31:02 +00:00
Fred Drake 699f352fb2 Trent Mick <trentm@activestate.com>:
This patch fixes the posix module for large file support mainly on
Win64, although some general cleanup is done as well.

The changes are:

- abstract stat->STAT, fstat->FSTAT, and struct stat->STRUCT_STAT
This is because stat() etc. are not the correct functions to use on
Win64 (nor maybe on other platforms?, if not then it is now trivial to
select the appropriate one). On Win64 the appropriate system functions
are _stati64(), etc.

- add _pystat_fromstructstat(), it builds the return tuple for the
fstat system call. This functionality was being duplicated. As well
the construction of the tuple was modified to ensure no overflow of
the time_t elements (sizeof(time_t) > sizeof(long) on Win64).

- add overflow protection for the return values of posix_spawnv and
posix_spawnve

- use the proper 64-bit capable lseek() on Win64

- use intptr_t instead of long where appropriate from Win32/64 blocks
(sizeof(void*) > sizeof(long) on Win64)

This closes SourceForge patch #100513.
2000-06-29 21:12:41 +00:00
Fred Drake dfb4ebda24 Trent Mick <trentm@activestate.com>:
Mark Hammond provided (a long time ago) a better Win32 specific
time_clock implementation in timemodule.c. The library for this
implementation does not exist on Win64 (yet, at least). This patch
makes Win64 fall back on the system's clock() function for
time_clock().

This closes SourceForge patch #100512.
2000-06-29 20:56:28 +00:00
Fredrik Lundh 8094611eb8 - fixed another split problem
(those semantics are weird...)

- got rid of $Id$'s (for the moment, at least).  in other
  words, there should be no more "empty" checkins.

- internal: some minor cleanups.
2000-06-29 18:03:25 +00:00
Fredrik Lundh be2211e940 - fixed split
(test_sre still complains about split, but that's caused by
  the group reset bug, not split itself)

- added more mark slots
  (should be dynamically allocated, but 100 is better than 32.
  and checking for the upper limit is better than overwriting
  the memory ;-)

- internal: renamed the cursor helper class

- internal: removed some bloat from sre_compile
2000-06-29 16:57:40 +00:00
Barry Warsaw 3937c8a738 Updated the comment in this file to reflect the new defaults. Threads
are enabled by default now unless --without-threads is given to
configure.
2000-06-29 16:08:28 +00:00
Jeremy Hylton a22a0b3e86 pyexpat notes: add the name of the archive to the ar command 2000-06-29 14:40:45 +00:00
Fredrik Lundh b389df3402 - renamed "tolower" hook (it happened to work with
my compiler, but not on guido's box...)
2000-06-29 12:48:37 +00:00
Fredrik Lundh 75f2d675ed - last patch broke parse_template; fixed by changing some
tests in sre_patch back to previous version

- fixed return value from findall

- renamed a bunch of functions inside _sre (way too
  many leading underscores...)

</F>
2000-06-29 11:34:28 +00:00
Fredrik Lundh 6c68dc7b1a - removed "alpha only" licensing restriction
- removed some hacks that worked around 1.6 alpha bugs
- removed bogus test code from sre_parse
2000-06-29 10:34:56 +00:00
Fredrik Lundh 436c3d58a2 towards 1.6b1 2000-06-29 08:58:44 +00:00
Fredrik Lundh 102f3ad676 towards 1.6b1 2000-06-29 08:55:54 +00:00
Fred Drake 3de16f3db4 Improve explanation of how to build the pyexpat module. 2000-06-29 05:29:08 +00:00
Guido van Rossum 4f4b799b33 Jack Jansen: Use include "" instead of <>; and staticforward declarations 2000-06-29 00:06:39 +00:00
Guido van Rossum cc6a438d7f Trent Mick:
Fix warnings on 64-bit build build of signalmodule.c

- Though I know that SIG_DFL and SIG_IGN are just small constants,
there are cast to function pointers so the appropriate Python call is
PyLong_FromVoidPtr so that the pointer value cannot overflow on Win64
where sizeof(long) < sizeof(void*).
2000-06-28 22:26:21 +00:00
Guido van Rossum 534b7c5c96 Trent Mick:
This patch fixes cPickle.c for 64-bit platforms.

- The false assumption sizeof(long) == size(void*) exists where
PyInt_FromLong is used to represent a pointer. The safe Python call
for this is PyLong_FromVoidPtr. (On platforms where the above
assumption *is* true a PyInt is returned as before so there is no
effective change.)

- use size_t instead of int for some variables
2000-06-28 22:23:56 +00:00
Guido van Rossum fa48116993 Trent Mick: use size_t instead of int where appropriate (time_strftime()). 2000-06-28 21:33:59 +00:00
Guido van Rossum e826895d48 Trent Mick: use size_t instead of int where appropriate (set_key()). 2000-06-28 21:31:10 +00:00
Guido van Rossum 26418a90f0 Trent Mick: use size_t instead of int where appropriate (call_readline()). 2000-06-28 21:30:31 +00:00
Guido van Rossum 2650a42f0b Trent Mick: use size_t instead of int where appropriate (mpz_format()). 2000-06-28 21:29:47 +00:00
Guido van Rossum b6f657c0cc Trent Mick: use size_t instead of int where appropriate (various spots). 2000-06-28 21:29:03 +00:00
Guido van Rossum 7d0ae5e14e Trent Mick: use size_t instead of int where appropriate (in
fromfile(), to hold fread() result.)
2000-06-28 21:27:21 +00:00
Guido van Rossum 2f8a054418 Trent Mick: use size_t instead of int where appropriate (in strxfrm(),
to hold strlen() outcome).
2000-06-28 21:23:33 +00:00
Guido van Rossum 3262e16753 Trent Mick:
This patches fixes a possible overflow of the optional timeout
parameter for the select() function (selectmodule.c). This timeout is
passed in as a double and then truncated to an int. If the double is
sufficiently large you can get unexpected results as it
overflows. This patch raises an overflow if the given select timeout
overflows.

[GvR: To my embarrassment, the original code was assuming an int could
always hold a million.  Note that the overflow check doesn't test for
a very large *negative* timeout passed in -- but who in the world
would do such a thing?]
2000-06-28 21:18:13 +00:00
Guido van Rossum 40ced50cb0 Jack Jansen: Mac Carbon: don't include sys/types if we don't have it 2000-06-28 20:56:30 +00:00
Fred Drake 541dc3b7b2 Trent Mick <trentm@activestate.com>:
The cause: Relatively recent (last month) patches to getargs.c added
overflow checking to the PyArg_Parse*() integral formatters thereby
restricting 'b' to unsigned char value and 'h','i', and 'l' to signed
integral values (i.e. if the incoming value is outside of the
specified bounds you get an OverflowError, previous it silently
overflowed).

The problem: This broke the array module (as Fredrik pointed out)
because *its* formatters relied on the loose allowance of signed and
unsigned ranges being able to pass through PyArg_Parse*()'s
formatters.

The fix: This patch fixes the array module to work with the more
strict bounds checking now in PyArg_Parse*().

How: If the type signature of a formatter in the arraymodule exactly
matches one in PyArg_Parse*(), then use that directly. If there is no
equivalent type signature in PyArg_Parse*() (e.g. there is no unsigned
int formatter in PyArg_Parse*()), then use the next one up and do some
extra bounds checking in the array module.

This partially closes SourceForge patch #100506.
2000-06-28 17:49:30 +00:00
Marc-André Lemburg 2dabf69f5c Marc-Andre Lemburg <mal@lemburg.com>:
Added new ucnhash module by Bill Tutt.
2000-06-28 16:42:39 +00:00
Marc-André Lemburg b0c0ecfa26 Marc-Andre Lemburg <mal@lemburg.com>:
Added new ucnhash module.
2000-06-28 16:42:14 +00:00
Fred Drake 8cef4cf737 Thomas Wouters <thomas@xs4all.net>:
This patch adds the openpty() and forkpty() library calls to posixmodule.c,
when they are available on the target
system. (glibc-2.1-based Linux systems, FreeBSD and BSDI at least, probably
the other BSD-based systems as well.)

Lib/pty.py is also rewritten to use openpty when available, but falls
back to the old SGI method or the "manual" BSD open-a-pty
code. Openpty() is necessary to use the Unix98 ptys under Linux 2.2,
or when using non-standard tty names under (at least) BSDI, which is
why I needed it, myself ;-) forkpty() is included for symmetry.
2000-06-28 16:40:38 +00:00
Marc-André Lemburg 8fb8748a5f Marc-Andre Lemburg <mal@lemburg.com>:
New ucnhash module by Bill Tutt. This module contains the hash
table needed to map Unicode character names to Unicode ordinals
and is loaded on-the-fly by the standard unicode-escape codec.
2000-06-28 16:38:56 +00:00
Andrew M. Kuchling a1e4b05ac4 Fixes for compiling on Tru64.
Define a STRICT_SYSV_CURSES macro on SGI, Sun, and Tru64, to mark systems
that don't support some features.
2000-06-27 21:49:47 +00:00
Andrew M. Kuchling b6e468796a Fix two typos (, instead of ;) 2000-06-27 15:01:10 +00:00
Andrew M. Kuchling 8e9d23b250 Added support for mouse functions: mousemask(), mouseinterval(),
getmouse(), ungetmouse(), and window.enclose().  wmouse_trafo() seems
of marginal importance at the moment.
2000-06-27 03:10:38 +00:00
Andrew M. Kuchling beba056cd7 Added support for passing Unicode strings to Expat handlers by default.
This version still includes #ifdef hackery to compile with 1.5.2.
2000-06-27 00:33:30 +00:00
Andrew M. Kuchling f419572708 Release the global interpreter lock around the most important
functions that might block or pause
2000-06-23 01:36:21 +00:00
Andrew M. Kuchling 97311bbb0e Added .timeout() method and .typeahead() function 2000-06-21 01:41:48 +00:00
Fred Drake aef1000bff Fixed docstring typo, reported by Skip Montanaro <skip@mojam.com>. 2000-06-19 13:17:41 +00:00
Andrew M. Kuchling 288e97b7fe Patch from Michael Hudson to fix flatten recursive data structures:
[mwh21@atrus build]$ ./python
>>> import Tkinter
>>> l = []
>>> l.append(l)
>>> Tkinter._flatten(l)
Segmentation fault (core dumped)
2000-06-19 00:55:09 +00:00
Andrew M. Kuchling ea34a84e54 Patch from Lorenzo M. Catucci:
I discovered the [MREMAP_MAYMOVE] symbol is only defined when _GNU_SOURCE is
defined; therefore, here is the change: if we are compiling for linux,
define _GNU_SOURCE before including mman.h, and all is done.
2000-06-18 19:06:49 +00:00
Andrew M. Kuchling e475e70128 Patch from /F:
this patch adds a fast _flatten function to the _tkinter
module, and imports it from Tkinter.py (if available).

this speeds up canvas operations like create_line and
create_polygon.  for example, a create_line with 5000
vertices runs about 50 times faster with this patch in
place.
2000-06-18 18:45:50 +00:00
Andrew M. Kuchling 6fef30e1fa Support resizing the mapping depending on whether HAVE_MREMAP is defined
Remove two unused variables
2000-06-18 14:51:21 +00:00
Andrew M. Kuchling 70d2742fce Patch from Trent Mick:
The seek() method is broken for any 'whence' value (seek from
	start, current, orend) other than the default. I have a patch
	that fixes that as well as gets mmap'd files working on
	Linux64 and Win64.
2000-06-18 04:45:14 +00:00
Andrew M. Kuchling 9bc5f3339a Removed MS_INVALIDATE flags 2000-06-18 04:25:08 +00:00
Andrew M. Kuchling 7b9fb92932 Fix the size() method to return the size of the file on Unix, not the
size of the mapped area.  This seems to be what the Windows version does.
This change requires keeping around the fd of the mapped file.
2000-06-17 22:41:22 +00:00
Andrew M. Kuchling b7f198e01a Renamed the C extension for ncurses support from 'curses' to '_curses'.
(The SourceForge admins have been asked to rename the ,v file.)
2000-06-10 23:12:32 +00:00
Marc-André Lemburg 753131c90a Marc-Andre Lemburg <mal@lemburg.com>:
The locale module is turned on per default.
2000-06-07 09:12:54 +00:00
Andrew M. Kuchling 54c8dc2144 Patch from Trent Mick:
Fix a small bug in posixmodule.c where a char* is being
	dereferenced where it should not be.
2000-06-06 20:52:17 +00:00
Andrew M. Kuchling 841b9fbebb Use PyArg_ParseTuple and specify the method names, following a suggestion
from Greg Stein
2000-06-03 20:43:43 +00:00
Andrew M. Kuchling 961fe17b4c Add missing PyArg_NoArgs() calls to methods that didn't take arguments
(Pointed out by Moshe Zadka)
2000-06-03 19:41:42 +00:00
Jeremy Hylton b1aa19515f Fredrik Lundh: here's the 96.6% version of SRE 2000-06-01 17:39:12 +00:00
Andrew M. Kuchling 94c3452ade Fix bug reported by atkins@gweep.net; re.compile(r"[\100-\410]")
dumps core.  Solution: fix check_escape() to match its comment and
   use only the low 8 bits of the octal number.
2000-06-01 03:02:48 +00:00
Fred Drake 137507ea03 Michael Hudson <mwh21@cam.ac.uk>:
Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
2000-06-01 02:02:46 +00:00
Jeremy Hylton 847a9968e9 Patch from M.-A. Lemburg:
Python on UNIX now trusts PYTHONHOME unconditionally

Modules/getpath.c:

Landmark changed to os.py.

Setting PYTHONHOME now unconditionally sets sys.prefix
(and sys.exec_prefix). No further checks are done whether the
standard lib can be found in that location or not. This is in
sync with the PC subdir getpath implementations.

PC/getpathp.c:

Landmark changed to os.py.

PC/os2vacpp/getpathp.c:

Landmark changed to os.py.

Note: BAW's checkin on exceptions.c eliminates earlier concerns about
a bogus PYTHONHOME value leading to a core dump.  Instead it causes a
useless sys.path and prevents imports.
2000-05-26 21:49:07 +00:00
Barry Warsaw c8019add6c _exceptions.c is moved to ../Python/exceptions.c 2000-05-26 19:03:19 +00:00
Barry Warsaw b1387aa7af The _exceptions module is moved to the Python subdirectory. 2000-05-26 19:02:42 +00:00
Barry Warsaw 8415edb433 Built-in class-based standard exceptions. Written by Fredrik Lundh.
Modified, proofread, and integrated for Python 1.6 by Barry Warsaw.
2000-05-25 23:18:47 +00:00
Barry Warsaw cfa2dba720 Added the _exceptions module, implementing the built-in class-based
standard exceptions.
2000-05-25 23:10:52 +00:00
Andrew M. Kuchling 03e644b851 Changes by AMK: Use HAVE_NCURSES_H to include correct header file
Lots of typo fixes (a bit too much cut-and-paste in this module)
Aliases removed: attr_on, attr_off, attr_set
Lowercased the names COLOR_PAIR and PAIR_NUMBER
#ifdef's for compiling on Solaris added (need to understand SYSV curses
    versions better and generalize this)
Bumped version number bumped to 1.6
2000-05-23 16:24:54 +00:00
Andrew M. Kuchling 22b88ce6bf Oliver Andrich's ncurses-specific curses module, version 1.5b1 2000-05-23 16:18:03 +00:00
Fred Drake 11b093641a Donn Cave <donn@oz.net>:
BeOS (up to 5.0) lacks <netinet/tcp.h>.
2000-05-16 13:30:12 +00:00
Guido van Rossum c9a5f343bc The addition of rint() (by Peter Schneider-Kamp; I forgot to mention
that before) in the previous patch has one problem; rint() is not in
the C math library on all platforms (e.g. not for VC++).  Make it
conditional on HAVE_RINT.
2000-05-11 18:42:27 +00:00
Guido van Rossum 71260b846e Added math.rint() -- round according to current IEEE754 mode 2000-05-11 18:19:42 +00:00
Fred Drake aff601804d M.-A. Lemburg <mal@lemburg.com>:
Fixed a bug due to a /* inside /*...*/. GCC doesn't like
this and bombs.
2000-05-09 19:52:40 +00:00
Guido van Rossum ea2b7157ab New version from Jim Fulton to fix a problem that Eric Raymond ran
into.  Jim writes:

The core dump was due to a C decrement operation
in a macro invocation in load_pop.  (BAD)

I fixed this by moving the decrement outside
the macro call.

I added a comment to load_pop and load_mark
to document the fact that cPickle separates the
unpickling stack into two separate stacks, one for
objects and one for marks.

I also moved some increments out of some macro
calls (PyTuple_SET_ITEM and PyList_SET_ITEM).
This wasn't necessary, but made me feel better. :)

I tested these changes in *my* cPickle, which
doesn't have the new Unicode stuff.
2000-05-09 18:14:50 +00:00
Guido van Rossum c554505ca1 Trent Mick:
Fix overflow bug in ldexp(x, exp). The 'exp' argument maps to a C int for the
math library call [double ldexp(double, int)], however the 'd'
PyArg_ParseTuple formatter was used to yield a double, which was subsequently
cast to an int. This could overflow.

[GvR: mysteriously, on Solaris 2.7, ldexp(1, 2147483647) returns Inf
while ldexp(1, 2147483646) raises OverflowError; this seems a bug in
the math library (it also takes a real long time to compute the
Inf outcome).  Does this point to a bug in the CHECK() macro?  It
should have discovered that the result was outside the HUGE_VAL range.]
2000-05-08 14:29:38 +00:00
Guido van Rossum 69529ad0cc When the UTF-8 conversion to Unicode fails, return an 8-bit string
instead.  This seems more robust than returning an Unicode string with
some unconverted charcters in it.

This still doesn't support getting truly binary data out of Tcl, since
we look for the trailing null byte; but the old (pre-Unicode) code did
this too, so apparently there's no need.  (Plus, I really don't feel
like finding out how Tcl deals with this in each version.)
2000-05-04 15:55:17 +00:00
Guido van Rossum 990f5c6c98 Two changes to improve (I hope) Unicode support.
1. In Tcl 8.2 and later, use Tcl_NewUnicodeObj() when passing a Python
Unicode object rather than going through UTF-8.  (This function
doesn't exist in Tcl 8.1, so there the original UTF-8 code is still
used; in Tcl 8.0 there is no support for Unicode.)  This assumes that
Tcl_UniChar is the same thing as Py_UNICODE; a run-time error is
issued if this is not the case.

2. In Tcl 8.1 and later (i.e., whenever Tcl supports Unicode), when a
string returned from Tcl contains bytes with the top bit set, we
assume it is encoded in UTF-8, and decode it into a Unicode string
object.

Notes:

- Passing Unicode strings to Tcl 8.0 does not do the right thing; this
isn't worth fixing.

- When passing an 8-bit string to Tcl 8.1 or later that has bytes with
the top bit set, Tcl tries to interpret it as UTF-8; it seems to fall
back on Latin-1 for non-UTF-8 bytes.  I'm not sure what to do about
this besides telling the user to disambiguate such strings by
converting them to Unicode (forcing the user to be explicit about the
encoding).

- Obviously it won't be possible to get binary data out of Tk this
way.  Do we need that ability?  How to do it?
2000-05-04 15:07:16 +00:00
Guido van Rossum b18618dab7 Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.

(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode.  I'm also holding back on his
change to main.c, which seems unnecessary to me.)
2000-05-03 23:44:39 +00:00
Guido van Rossum 2808b744e8 Remove all references to stdwin. 2000-05-03 22:34:12 +00:00
Guido van Rossum 31c9a27c12 >>Boing!<<
Finally, this long-obsolete module bites the dust.
2000-05-03 22:33:14 +00:00
Guido van Rossum 98e189dab4 Vladimir Marangozov:
Change Py_Malloc/Realloc/Free calls to PyMem_Malloc/Realloc/Free +
PyErr_Nomemory on error check.  Py_Malloc c.s. are obsolete.
2000-05-03 22:30:13 +00:00
Guido van Rossum 19dde103a8 Mark Hammond to the rescue:
Checkin 2.131 of posixmodule.c changed os.stat on Windows, so that
"/bin/" type notation (trailing backslash) would work on Windows to
be consistent with Unix.

However, the patch broke the simple case of: os.stat("\\")

This did work in 1.5.2, and obviously should!

This patch addresses this, and restores the correct behaviour.
2000-05-03 02:44:55 +00:00
Guido van Rossum 7d64b48eaf Disable the ZEROTRAP code -- this turns a 0 byte into a 2 byte and I
don't think that's what we want.  There was some brief discussion
of this somewhere but I don't recall where.
2000-05-02 21:18:13 +00:00
Barry Warsaw 57e11ae847 usage_mid: Remove the description of the -X flag; it's gone now.
Py_Main(): Remove the 'X' case.
2000-05-02 19:20:26 +00:00
Barry Warsaw ee98e4e75d Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
Guido van Rossum c15a9a1f98 Marc-Andre Lemburg:
Added -U command line option.

With the option enabled the Python compiler interprets all "..."
strings as u"..." (same with r"..." and ur"...").
2000-05-01 17:54:33 +00:00
Barry Warsaw 3cef856dd9 posix_utime(): Allow the second argument to be None, which invokes the
utime(path, NULL) call, setting the atime and mtime of the file to the
current time.  The previous signature utime(path, (atime, mtime)) is
of course still allowed.
2000-05-01 16:17:24 +00:00
Guido van Rossum 8823accd1f Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
2000-04-27 20:14:31 +00:00
Guido van Rossum c410e92974 Jack Jansen:
This patch is a workaround for Macintosh, where the GUSI I/O library
(time, stat, etc) use the MacOS epoch of 1-Jan-1904 and the MSL C
library (ctime, localtime, etc) uses the (apparently ANSI standard)
epoch of 1-Jan-1900. Python programs see the MacOS epoch and we
convert values when needed.
2000-04-26 20:40:13 +00:00
Guido van Rossum 50422b403c Michael Hudson:
This patch changes posixmodule.c:execv to

a) check for zero length args (does this to execve, too), raising
   ValueError.

b) raises more rational exceptions for various flavours of duff arguments.
   I *hate*
      TypeError: "illegal argument type for built-in operation"
   It has to be one of the most frustrating error messages ever.
2000-04-26 20:34:28 +00:00
Guido van Rossum 14f3f59d2b Fix typo in last patch -- the symbol's name is MSG_DONWAIT, not
MSG_DONTWAIT.  Reported by Fredrik Lundh.
2000-04-25 21:53:58 +00:00
Guido van Rossum 2c8bcb8794 Patch by Charles G Waldman:
1)  Adds MSG_DONTWAIT if defined (I needed this)
2)  Spells "coreectly" correctly ;-)
2000-04-25 21:34:53 +00:00