Mark Hammond [Tue, 15 Jul 2003 23:03:55 +0000 (23:03 +0000)]
Fix [ 771097 ] frozen programs fail due to implicit import of "warnings".
If the initial import of warnings fails, clear the error. When the module
is actually needed, if the original import failed, see if it has managed
to find its way to sys.modules yet and if so, remember it.
Jeremy Hylton [Tue, 15 Jul 2003 20:23:26 +0000 (20:23 +0000)]
SF patch 763201: handling of SyntaxErrors in symbol table build
Fixes for three related bugs, including errors that caused a script to
be ignored without printing an error message. The key problem was a bad
interaction between syntax warnings and syntax errors. If an
exception was already set when a warning was issued, the warning could
clobber the exception.
The PyErr_Occurred() check in issue_warning() isn't entirely
satisfying (the caller should know whether there was already an
error), but a better solution isn't immediately obvious.
Fred Drake [Mon, 14 Jul 2003 21:46:23 +0000 (21:46 +0000)]
Remove proxy_print(), since that caused an inconsistency between
"print repr(proxy(a))" and "proxy(a)" at an interactive prompt.
Closes SF bug #722763.
Andrew MacIntyre [Sun, 13 Jul 2003 13:41:59 +0000 (13:41 +0000)]
More pre-2.3 build tweaks for the OS/2 EMX port:
- separate the building of the core from the wrapper executables and the
external modules (.PYDs), based on the Py_BUILD_CORE define;
- clean up the generated import library definiton (.DEF file) to remove
references to a number of non-static symbols that aren't part of the
Python API and which shouldn't be exported by the core DLL;
- compile the release build with -fomit-frame-pointer, for a small
performance gain;
- make "make clean" remove byte compiled Python library files.
* It ran fine under "python regrtest.py test_warnings" but failed under
"python regrtest.py" presumably because other tests would add to
filtered warnings and not reset them at the end of the test.
* Converted to a unittest format for better control. Renamed
monkey() and unmonkey() to setUp() and tearDown().
* Increased coverage by testing all warnings in __builtin__.
* Increased coverage by testing regex matching of specific messages.
This test failed on WindowsME because the full file path did not get
reported consistently with the *nix world. 'Lib/test/test_warnings.py'
came out as 'lib\test\test_warnings.py'. The basename is all we care
about so I used that.
Tim Peters [Sun, 13 Jul 2003 02:22:03 +0000 (02:22 +0000)]
Fixed critical shutdown race in _Database._commit.
Related to SF patch 723231 (which pointed out the problem, but didn't
fix it, just shut up the warning msg -- which was pointing out a dead-
serious bug!).
Tim Peters [Sat, 12 Jul 2003 20:11:25 +0000 (20:11 +0000)]
There's a persistent rumor on the spambayes mailing list that dumbdbm
databases are associated with corruption problems, so I studied this code
carefully and ran some brutal stress tests. I didn't find any bugs,
although it's unclear whether this code *intends* that __setitem__ can
leave the directory file out of synch with the data file (so
if a dumbdbm isn't properly closed, and the value of an existing key
was ever replaced, corruption is almost certain, where "corruption"
means the directory file is out of synch with the data file).
Added many comments and generally modernized the code. Examples of the
latter: we have better ways of reading a whole file line-by-line now;
eval() now tolerates a trailing newline; the %r format code can be used
to avoid explicit repr/backtick calls; and the code often broke tuples
into their components when it was clearer and faster to just leave them
as tuples.
Jeremy Hylton [Fri, 11 Jul 2003 15:37:59 +0000 (15:37 +0000)]
Change warnings to avoid importing re module during startup.
Add API function simplefilter() that does not create or install
regular expressions to match message or module. Extend the filters
data structure to store None as an alternative to re.compile("").
Move the _test() function to test_warnings and add some code to try
and avoid disturbing the global state of the warnings module.
Andrew MacIntyre [Fri, 11 Jul 2003 12:16:48 +0000 (12:16 +0000)]
patch #766650 - whichdb not identifying dbm DBs when dbm linked with gdbm
At this point, the problem appears particular to the OS/2 EMX port of
gdbm (which is at v1.7.3) - this combination produces a .pag file but
no .dir file.
A more sophisticated patch which checks magic numbers when dbm.library
indicates that dbm is linked to gdbm, and there is no .dir file, is
still attached to the above patch entry for reconsideration after 2.3
is released.
This checkin applies a workaround specific to the known failure case.
Just van Rossum [Thu, 10 Jul 2003 14:53:27 +0000 (14:53 +0000)]
Fixed a bug that's been there from the beginning but wasn't noticed
until now: the inheritance of default values was the wrong way around.
This caused app bundles to get a type of "BNDL" instead of "APPL".
Apparently this is not a problem until you try to drag your app to
the dock.
----------------------------------------------------------------------
Andrew MacIntyre [Thu, 10 Jul 2003 12:52:54 +0000 (12:52 +0000)]
Extend the pwd & grp emulations to support accessing the pwd/grp
record tuple by name as well as index, to match the behaviour of
the pwd/grp extension modules for Unix. These emulation modules
now pass test_pwd & test_grp.
* Extended DB & DBEnv set_get_returns_none functionality to take a
"level" instead of a boolean flag. The boolean 0 and 1 values still
have the same effect. A value of 2 extends the "return None instead
of raising an exception" behaviour to the DBCursor set methods.
This will become the default behaviour in pybsddb 4.2.
* Fixed a typo in DBCursor.join_item method that made it crash instead
of returning a value. Obviously nobody uses it. Wrote a test case
for join and join_item.
Fred Drake [Tue, 8 Jul 2003 15:57:52 +0000 (15:57 +0000)]
Improve compatibility with more versions of LaTeX2HTML and more LaTeX
markup. Not currently needed, but easier to save this now than to
have to figure it out when we do.
Fix a typo/cut-n-paste error in DBCursor.join_item so that it doesn't
return a tuple. (this also implies that nobody uses this method; the
bug has been here for a long time)