Commit Graph

13355 Commits

Author SHA1 Message Date
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
Fred Drake a3f6e91307 This patch extends PC/config.h and configure.in as appropriate for
64-bit readiness (the config values are needed for patches that I will
be submitting later today. The changes are as follows:

- add SIZEOF_OFF_T #define's to PC/config.h (it was already in configure.in)

- add SIZEOF_TIME_T #define to PC/config.h and configure
Needed for some buffer overflow checking because sizeof(time_t) is
different on Win64.

- add SIZEOF_FPOS_T #define
Needed for the Win64 large file support implementation.

- add SIZEOF_HKEY in PC/config.h only
Needed for proper Win32 vs. Win64 handling in PC/winreg.c

- #define HAVE_LARGEFILE_SUPPORT for Win64

- typedef long intptr_t; for all Windows except Win64 (which defines it
itself)
This is a new ANSI (I think) type that is useful (and used by me) for
proper handling in msvcrtmodule.c and posixmodule.c

- indent the nested #ifdef's and #defines in PC/config.h
This is *so* much more readable. There cannot be a compiler
compatibilty issue here can there? Perl uses indented #defines and it
compiles with everything.
2000-06-29 20:44:47 +00:00
Fred Drake d04038d9d2 Update comments relating to the removal of the -X option and of string
exceptions in the interpreter and standard library.
2000-06-29 20:15:14 +00:00
Fred Drake c6e72e0b45 Typo. 2000-06-29 20:02:38 +00:00
Fred Drake 252af9ca27 The low-level interface is now in _winreg; update the import here. 2000-06-29 19:42:00 +00:00
Fred Drake 55c3819e6a Paul Prescod <paul@prescod.net>:
W3C DOM implementation for Python.
2000-06-29 19:39:57 +00:00
Fred Drake 3f6a7b5efb Package docstring. 2000-06-29 19:36:27 +00:00
Guido van Rossum 3e06ab1d44 The usual :) 2000-06-29 19:35:29 +00:00
Fred Drake 45cd9de2bb Paul Prescod <paul@prescod.net>:
SAX interfaces for Python.
2000-06-29 19:34:54 +00:00
Fred Drake 0d800e1481 Package docstring and initialization. 2000-06-29 19:33:43 +00:00
Fred Drake e85c350600 Package docstring. 2000-06-29 19:28:01 +00:00
Fred Drake 13634cf7a4 This patch addresses two main issues: (1) There exist some non-fatal
errors in some of the hash algorithms. For exmaple, in float_hash and
complex_hash a certain part of the value is not included in the hash
calculation. See Tim's, Guido's, and my discussion of this on
python-dev in May under the title "fix float_hash and complex_hash for
64-bit *nix"

(2) The hash algorithms that use pointers (e.g. func_hash, code_hash)
are universally not correct on Win64 (they assume that sizeof(long) ==
sizeof(void*))

As well, this patch significantly cleans up the hash code. It adds the
two function _Py_HashDouble and _PyHash_VoidPtr that the various
hashing routine are changed to use.

These help maintain the hash function invariant: (a==b) =>
(hash(a)==hash(b))) I have added Lib/test/test_hash.py and
Lib/test/output/test_hash to test this for some cases.
2000-06-29 19:17:04 +00:00
Fred Drake b46696c0ed [Old patch that hadn't been checked in.]
get_starttag_text():  New method.
        Return the text of the most recently parsed start tag, from
        the '<' to the '>' or '/'.  Not really useful for structure
        processing, but requested for Web-related use.  May also be
        useful for being able to re-generate the input from the parse
        events, but there's no equivalent for end tags.

attrfind:  Be a little more forgiving of unquoted attribute values.
2000-06-29 18:50:59 +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 34a96371c3 - workaround to make 1.6 build under MSVC 5.0. hopefully,
trent (who broke it in the first place ;-) will come up
  with a cleaner solution.
2000-06-29 17:25:30 +00:00
Guido van Rossum 1bfdc78c84 Skip Montanaro: modify test_socket.py to listen/connect using loopback addr 2000-06-29 17:00:54 +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
Fred Drake 69218178ec Paul Prescod <paul@prescod.net>:
OO wrapper for _winreg; blessed by Mark Hammond.
2000-06-29 16:53:06 +00:00
Fred Drake ee8c418408 Finish converting the winreg extension to _winreg. 2000-06-29 16:43:49 +00:00
Guido van Rossum 5917ecb0a4 Nils Fischbeck: added doc strings to everything. Martin von Loewis
has reviewed this, too.
2000-06-29 16:30:50 +00:00
Guido van Rossum 26e89d0185 Change string exceptions to class exceptions. 2000-06-29 16:15:52 +00:00
Fred Drake 270e19b060 Update the module name to _winreg, pending checkin of Paul Prescod's
OO wrapper for this module.
2000-06-29 16:14:14 +00:00
Barry Warsaw c0d24d8bbf Thread support is turned on my default now. To disable building
threads use --without-threads.  No extra tests of thread/compiler
combinations have been added.

--with(out)-thread and --with(out)-threads are completely
interchangeable.

--with-threads still supports the =DIRECTORY option for specifying
where to find thread libraries.
2000-06-29 16:12:00 +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
Guido van Rossum 338311378e Change the loop index in normalizestring() to size_t too, to avoid a
warning on Windows.
2000-06-29 14:50:15 +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
Guido van Rossum 63b08ac2f7 Whoops! We just discovered that Gordon's revamp of this module was
accidentally wiped out by Ping's patch (which shouldn't have affected
this file at all, had Ping done a cvs update).

This checkin restores Gordon's version, with Fredrik's change merged
back in.
2000-06-29 14:13:28 +00:00
Marc-André Lemburg a2aa34f243 Marc-Andre Lemburg <mal@lemburg.com>:
New test output
2000-06-29 13:31:10 +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
Greg Ward 6fc9f8ed18 Typo fix. 2000-06-29 12:45:50 +00:00
Fredrik Lundh 4781b07201 - make sure group names are valid identifiers
(closes the "SRE: symbolic reference" bug)
2000-06-29 12:38:45 +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
Greg Stein e97ecf9705 demonstration importers 2000-06-29 11:05:30 +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
Fred Drake ffdc48f45c Convert to use class-based exceptions.
Correct exception information in one docstring.
2000-06-29 05:06:02 +00:00
Fred Drake 8aa3bd9098 Make it clear that id() can return either a long integer or a plain integer. 2000-06-29 03:46:46 +00:00
Fred Drake 0f353ed90d Add update of httplib docs to reflect Greg Stein's recent updates.
Greg, this is yours!
2000-06-29 03:33:28 +00:00
Greg Ward df112a76a9 Fixed so 'get_source_files()' calls 'check_extension_list()' -- that way,
we can run "sdist" on a distribution with old-style extension structures
even if we haven't built it yet.  Bug spotted by Harry Gebel.
2000-06-29 02:16:24 +00:00
Greg Ward 499822d959 Fixed 'findall()' so it only returns regular files -- no directories.
Changed 'prune_file_list()' so it also prunes out RCS and CVS directories.
Added 'is_regex' parameter to 'select_pattern()', 'exclude_pattern()',
  and 'translate_pattern()', so that you don't have to be constrained
  by the simple shell-glob-like pattern language, and can escape into
  full-blown regexes when needed.  Currently this is only available
  in code -- it's not exposed in the manifest template mini-language.
Added 'prune' option (controlled by --prune and --no-prune) to determine
  whether we call 'prune_file_list()' or not -- it's true by default.
Fixed 'negative_opt' -- it was misnamed and not being seen by dist.py.
Added --no-defaults to the option table, so it's seen by FancyGetopt.
2000-06-29 02:06:29 +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 e8d2d6b34c Some new names (some contributors of patches that haven't even been
accepted yet!)
2000-06-29 00:04:51 +00:00
Guido van Rossum 5e08cb8e50 Vladimir Marangozov:
This patch fixes a problem on AIX with the signed int case code in
getargs.c, after Trent Mick's intervention about MIN/MAX overflow
checks. The AIX compiler/optimizer generates bogus code with the
default flags "-g -O" causing test_builtin to fail: int("10", 16) <>
16L. Swapping the two checks in the signed int code makes the problem
go away.

Also, make the error messages fit in 80 char lines in the
source.
2000-06-28 23:53:56 +00:00
Guido van Rossum d7823f2645 Vladimir Marangozov:
Avoid calling the dealloc function, previously triggered with
DECREF(inst).  This caused a segfault in PyDict_GetItem, called with a
NULL dict, whenever inst->in_dict fails under low-memory conditions.
2000-06-28 23:46:07 +00:00
Guido van Rossum 98626cd7ac Urmpf. Quality control on this patch lapsed a bit. :-(
The depth field was never decremented inside w_object(), and it was
never initialized in PyMarshal_WriteObjectToFile().

This caused imports from .pyc files to fil mysteriously when the .pyc
file was written by the broken code -- w_object() would bail out
early, but PyMarshal_WriteObjectToFile() doesn't check the error or
return an error code, and apparently the marshalling code doesn't call
PyErr_Check() either.  (That's a separate patch if I feel like it.)
2000-06-28 23:24:19 +00:00
Guido van Rossum a04ff0fb53 Running the program through itself reveals that one end tag was
mislabeled.

(Using -c and then -e rearranges some comments, so I won't check that
in -- but it's a good test anyway.

Note that pindent is not perfect -- e.g. it doesn't know about
triple-quoted strings!)
2000-06-28 22:55:20 +00:00