Tim Peters [Tue, 15 Aug 2000 16:41:26 +0000 (16:41 +0000)]
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).
Fred Drake [Tue, 15 Aug 2000 16:20:36 +0000 (16:20 +0000)]
my_basename(): Removes the leading path components from a path name,
returning a pointer to the start of the file's "base" name;
similar to os.path.basename().
SyntaxError__str__(): Use my_basename() to keep the length of the
file name included in the exception message short.
Fred Drake [Tue, 15 Aug 2000 15:46:16 +0000 (15:46 +0000)]
SyntaxError__str__(): Do more formatting of the exception here, rather
than depending on the site that raises the exception. If the
filename and lineno attributes are set on the exception object,
use them to augment the message displayed.
This is part of what is needed to close SoruceForge bug #110628
(Jitterbug PR#278).
Greg Ward [Tue, 15 Aug 2000 13:03:16 +0000 (13:03 +0000)]
Added support for the '--dist-dir' option, including a mildly nasty
hack to find the two created RPM files (source and binary) and
move them to the "dist dir" (default "dist").
Greg Ward [Tue, 15 Aug 2000 13:01:25 +0000 (13:01 +0000)]
Fix long-hidden inconsistency in internal interface: 'find_modules()' now
represents packages as strings, not tuples. This allowed a simplification
in 'get_package_dir()', too -- can now assume that 'package' is a string.
Barry Warsaw [Tue, 15 Aug 2000 06:07:13 +0000 (06:07 +0000)]
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.
Barry Warsaw [Tue, 15 Aug 2000 06:03:35 +0000 (06:03 +0000)]
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.
Tim Peters [Tue, 15 Aug 2000 03:34:48 +0000 (03:34 +0000)]
Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.
This was a misleading bug -- the true "bug" was that hash(x) gave an error
return when x is an infinity. Fixed that. Added new Py_IS_INFINITY macro to
pyport.h. Rearranged code to reduce growing duplication in hashing of float and
complex numbers, pushing Trent's earlier stab at that to a logical conclusion.
Fixed exceedingly rare bug where hashing of floats could return -1 even if there
wasn't an error (didn't waste time trying to construct a test case, it was simply
obvious from the code that it *could* happen). Improved complex hash so that
hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
Mark Hammond [Tue, 15 Aug 2000 00:46:38 +0000 (00:46 +0000)]
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.
Fred Drake [Mon, 14 Aug 2000 20:59:57 +0000 (20:59 +0000)]
The attempt to protect against MS_WIN16 compilers that do not support long
string literals has not been tested on an MS_WIN16 platform; the trailing
";" was inside the #ifndef MS_WIN16, which should cause an error (missing
semi-colon) when compiled with that symbol #defined.
Fixed a couple of instances where a 0-length string was being
resized after creation. 0-length strings are usually shared
and _PyString_Resize() fails on these shared strings.
Mark Hammond [Mon, 14 Aug 2000 06:21:26 +0000 (06:21 +0000)]
Test for fix to bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName())
Mark Hammond [Mon, 14 Aug 2000 06:20:32 +0000 (06:20 +0000)]
Fix for Bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName())
Mark Hammond [Mon, 14 Aug 2000 04:47:33 +0000 (04:47 +0000)]
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.
Fred Drake [Mon, 14 Aug 2000 02:50:21 +0000 (02:50 +0000)]
In the section on the "Very High Level Layer", address concerns brought up
by Edward K. Ream <edream@users.sourceforge.net> about FILE* values and
incompatible C libraries in dynamically linked extensions. It is not clear
(to me) how realistic the issue is, but it is better documented than not.
Thomas Wouters [Sun, 13 Aug 2000 17:05:17 +0000 (17:05 +0000)]
The list comp patch checked for the second child node of the 'listmaker'
node, without checking if the node actually had more than one child. It can
have only one node, though: '[' test ']'. This fixes it.
Greg Ward [Sun, 13 Aug 2000 00:43:56 +0000 (00:43 +0000)]
Rene Liebscher:
* use self.debug_print() for debug messages
* uses now copy.copy() to copy lists
* added 'shared_lib_extension=".dll"', ... , this is necessary if you
want use the compiler class outside of the standard distutils build
process.
* changed result type of check_config_h() from int to string
Trent Mick [Sat, 12 Aug 2000 22:14:34 +0000 (22:14 +0000)]
Clean up warning from Monterey compiler.
Properly end a comment block. It was terminated fine later but by a subsequent
block and. It was also in #if 0. This patch is so trivial I can't believe I am
talking about it. :)
Trent Mick [Sat, 12 Aug 2000 21:37:39 +0000 (21:37 +0000)]
Clean up a warning on Win64. The downcast of the strlen size_t
return value to int is safe here because it previously checked that
there will be no overflow.
Trent Mick [Sat, 12 Aug 2000 21:35:36 +0000 (21:35 +0000)]
Clean up a couple of warnings on Win64. The downcast of the strlen size_t
return value to int is safe here because in each case it previouls checked that
there will be no overflow.
Trent Mick [Sat, 12 Aug 2000 20:58:11 +0000 (20:58 +0000)]
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.
Thomas Wouters [Sat, 12 Aug 2000 20:32:46 +0000 (20:32 +0000)]
Bring Tools/compiler almost up to date. Specifically:
- fix tab space issues (SF patch #101167 by Neil Schemenauer)
- fix co_flags for classes to include CO_NEWLOCALS (SF patch #101145 by Neil)
- fix for merger of UNPACK_LIST and UNPACK_TUPLE into UNPACK_SEQUENCE,
(SF patch #101168 by, well, Neil :)
- Adjust bytecode MAGIC to current bytecode.
Trent Mick [Sat, 12 Aug 2000 19:37:27 +0000 (19:37 +0000)]
Add the current Win64 compiler to the list of those that need the
huge switch statement broken up. This will probably not be necessary when
the Win64 compiler matures.
Guido van Rossum [Sat, 12 Aug 2000 14:45:50 +0000 (14:45 +0000)]
Whoever added the Makefile rule to auto-build the Grammar didn't have
his build directory in a different place than his source directory. I
do, and it is supposed to be supported. The naive patch caused an
endless recursion in the Make process. This should take care of that.
Trent Mick [Fri, 11 Aug 2000 23:20:32 +0000 (23:20 +0000)]
These files all used to be tagged as binary in CVS. I recently changed this so
that these files are treated as normal text files (which they are). However,
the files also had to be changed to be stored in CVS internally with UNIX line
terminators (they had DOS line terminators internally before this commit).
Thomas Wouters [Fri, 11 Aug 2000 22:26:35 +0000 (22:26 +0000)]
'make' in Grammar too, so graminit.h and graminit.c get re-build when
necessary. Do Grammar after Parser because Grammar needs Parser, and not the
other way 'round. This patch doesn't bother with dependencies because it's
tricky to get right (for instance for the modules that want graminit.h,
like cPickle) and other dependencies are broken to begin with.
Thomas Wouters [Fri, 11 Aug 2000 22:15:52 +0000 (22:15 +0000)]
Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since they
did the same anyway.
I'm not sure what to do with Tools/compiler/compiler/* -- that isn't part of
distutils, is it ? Should it try to be compatible with old bytecode version ?
Fred Drake [Fri, 11 Aug 2000 19:55:06 +0000 (19:55 +0000)]
getopt(): revise description of long_options parameter slightly so it will
be less confusing; add a paragraph separation so that comments about
the options and long_options parameters don't have references that
are easily misinterpreted.
Adjust the interactive examples to not need the string module.
Add an example showing how the module is commonly used in a script.
Trent Mick [Fri, 11 Aug 2000 19:02:59 +0000 (19:02 +0000)]
Add largefile support for Linux64 and WIn64. Add test_largefile and some minor
change to regrtest.py to allow optional running of test_largefile ('cause it's
slow on Win64).
This closes patches:
http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100510&group_id=5470
and
http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100511&group_id=5470
Fred Drake [Thu, 10 Aug 2000 21:41:08 +0000 (21:41 +0000)]
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.
Fredrik Lundh [Wed, 9 Aug 2000 18:51:01 +0000 (18:51 +0000)]
-- use explicit conversion instead of u-string literal in the test
code, to make the new Tkinter.py run under 1.5.2
-- changed Text.yview argument name (for consistency with xview)