Futher improvements to frozenset hashing (based on Yitz Gale's battery of
tests which nicely highly highlight weaknesses).
* Initial value is now a large prime.
* Pre-multiply by the set length to add one more basis of differentiation.
* Work a bit harder inside the loop to scatter bits from sources that
may have closely spaced hash values.
All of this is necessary to make up for keep the hash function commutative.
Fortunately, the hash value is cached so the call to frozenset_hash() will
only occur once per set.
* Non-zero initial value so that hash(frozenset()) != hash(0).
* Final permutation to differentiate nested sets.
* Add logic to make sure that -1 is not a possible hash value.
Neal Norwitz [Wed, 9 Jun 2004 01:46:02 +0000 (01:46 +0000)]
Ensure path is initialized to prevent freeing random memory
(reported by Thomas Heller). If have_unicode_filename is set,
path looks like it will not be used, so there's no need to free it.
Tim Peters [Mon, 7 Jun 2004 23:04:33 +0000 (23:04 +0000)]
SF 952807: Unpickling pickled instances of subclasses of datetime.date,
datetime.datetime and datetime.time could yield insane objects. Thanks
to Jiwon Seo for the fix.
Skip Montanaro [Mon, 7 Jun 2004 11:20:40 +0000 (11:20 +0000)]
Another nit found by Neal Norwitz using pychecker. This was caused by a
too-mechanical translation when converting html() to text() (simply stripped
strong() where it appeared).
Neal Norwitz [Mon, 7 Jun 2004 03:49:50 +0000 (03:49 +0000)]
Cleanup: the in operator already returns a bool, no need to bool() it again
Cleanup: use condition to be consistent with code above
CookieJar is in cookielib
Neal Norwitz [Sun, 6 Jun 2004 20:40:27 +0000 (20:40 +0000)]
Plug a few memory leaks in utime(). path is allocated from within
PyArg_ParseTuple() since the format is "et" This change should
be reviewed carefully.
Neal Norwitz [Sun, 6 Jun 2004 20:13:10 +0000 (20:13 +0000)]
Valgrind was reporting an uninitialized read for bad input.
This fixes the problem and the test passes. I'm not sure
the test is really correct though. It seems like it would
be better to raise an exception. I think that wasn't done
for backwards compatability.
Neal Norwitz [Sun, 6 Jun 2004 20:09:49 +0000 (20:09 +0000)]
Look for the multibyte codec map files in the parent directory too
This is similar to test_normalization, so that many source trees
can reference the same test file(s).
Kurt B. Kaiser [Sun, 6 Jun 2004 01:29:22 +0000 (01:29 +0000)]
Noam Raphel: Further developemt of CodeContext feature.
The visibility state of the code context pane is now persistent between
sessions and the pane does not appear in the shell window.
M CodeContext.py
M EditorWindow.py
M NEWS.txt
M PyShell.py
M config-extensions.def
M configHandler.py
Remove a number of tests that differ only in input data size. It seems
no bug motivated their inclusion and the chance of them triggering a
problem seems unlikely. Refactor to reduce code duplication. Rename
'hamlet_scene' to 'HAMLET_SCENE'. Test is much faster now. Closes #960995.
[Bug #921657] Allow '@' in unquoted HTML attributes. Not strictly legal according to the HTML REC, but HTMLParser is already a pretty loose parser. Reported by Bernd Zimmermann.
[Bug #954364] inspect.getframeinfo() sometimes produces incorrect traceback line #s; fix is to look at tb.tb_lineno, not tb.frame.f_lineno. Patch from Robin Becker and me.
SF bug #963956: Bad error mesage when subclassing a module
Add a more informative message for the common user mistake of subclassing
from a module name rather than another class (i.e. random instead of
random.random).
Jack Jansen [Thu, 3 Jun 2004 14:33:03 +0000 (14:33 +0000)]
Fix for #932977: MacOSX does not pass the whole pathname in argv[0] for
#!-scripts, only the filename part, and this can lead to incorrect
initialization of sys.path and sys.executable if there is another python
on $PATH before the one used in #!.
The fix was picked up from the darwinports crowd, thanks!
Jack Jansen [Thu, 3 Jun 2004 13:31:51 +0000 (13:31 +0000)]
Very large scripts folders could crash the IDE, because it runs out
of Menu IDs (of which there are only 255 in Carbon). Fixed by stopping
examining the scripts folder when we allocate menu ID 200.
Jack Jansen [Thu, 3 Jun 2004 12:41:45 +0000 (12:41 +0000)]
Partial fix for #887242 (link extensions with dynamic_lookup in stead
of hard linking against the framework).
If $MACOSX_DEPLOYMENT_TARGET is set, and >= 10.3, during configure we
setup extensions to link with dynamic lookup. We also record the
value in the Makefile.
Distutils checks whether a value for MACOSX_DEPLOYMENT_TARGET was
recorded in the Makefile, and if it was insists that the current
value matches.
This is only a partial fix because it only applies to 2.4, and the
"two python problem" exists with Python 2.3 shipped with MacOSX 10.3,
which we have no influence over.
Martin v. Löwis [Thu, 3 Jun 2004 09:24:42 +0000 (09:24 +0000)]
Patch #929192: Improvements to bluetooth support.
Added setbdaddr and makebdaddr.
Extended makesockaddr to understand Bluetooth addresses.
Changed getsockaddr to expect the Bluetooth addresses as a string,
not a six element tuple.
Reformatted some of the Bluetooth code to be more consistent with PEP 7.
Hye-Shik Chang [Wed, 2 Jun 2004 16:49:17 +0000 (16:49 +0000)]
- SF #962502: Add two more methods for unicode type; width() and
iswide() for east asian width manipulation. (Inspired by David
Goodger, Reviewed by Martin v. Loewis)
- Move _PyUnicode_TypeRecord.flags to the end of the struct so that
no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)