In order to make this test work on Windows, the test locale has to be
set to 'en' there -- Windows does not understand the 'en_US' locale.
The test succeeds there.
Set the SO_REUSEADDR socket option in the server thread -- this seems
needed on some platforms (e.g. Solaris 8) when the test is run twice
in quick succession.
Remove shared libraries as part of "make clean" rather than in "make
clobber". This is done so that after a "make clean", setup.py will
also recompile all extensions.
Mark Favas points out that there's an 'self.fp.flush()' call in the
ZipFile.close() method that should be part of the preceding 'if'
block. On some platforms (Mark noticed this on FreeBSD 4.2) doing a
flush() on a file open for reading is not allowed.
Pete Shinners discovered that zipfile.ZipFile() is called with mode
argument "wb", while the only valid modes are "r", "w" or "a". Fix
this by changing the mode to "w".
Add "import thread" at the top of the module; this prevents us from
failing later when Python is compiled without threading but a failing
'threading' module can be imported due to an earlier (caught) attempt.
Fred Drake [Sat, 14 Apr 2001 03:10:12 +0000 (03:10 +0000)]
If the sunaudiodev module is available but we cannot find an audio
device to use, skip this test instead of allowing an error to occur
when we attempt to play sound on the absent device.
Tim convinced me to augment the PSF license with a final clause just
like the one in the BeOpen license (and similar to the one in the CNRI
license, but with the "click-to-accept" part elided).
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.
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.)
Fred Drake [Fri, 13 Apr 2001 17:15:47 +0000 (17:15 +0000)]
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.
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.
Jeremy Hylton [Fri, 13 Apr 2001 16:51:46 +0000 (16:51 +0000)]
Change error message raised when free variable is not yet bound. It
now raises NameError instead of UnboundLocalError, because the var in
question is definitely not local. (This affects test_scope.py)
Also update the recent fix by Ping using get_func_name(). Replace
tests of get_func_name() return value with call to get_func_desc() to
match all the other uses.
Patch by Ping (SF bug 415879, Exception.__init__() causes segfault):
Calling an unbound method on a C extension class without providing
an instance can yield a segfault. Try "Exception.__init__()" or
"ValueError.__init__()".
This is a simple fix. The error-reporting bits in call_method
mistakenly treat the misleadingly-named variable "func" as a
function, when in fact it is a method.
If we let get_func_name take care of the work, all is fine.
Make force-loading optional; don't force-load in interactive mode.
Make synopsis() load modules as '__temp__' so they don't clobber anything.
Change "constants" section to "data" section.
Don't show __builtins__ or __doc__ in "data" section.
For Bob Weiner: don't boldface text in Emacs shells or dumb terminals.
Remove Helper.__repr__ (it really belongs in site.py, and should be guarded by a check for len(inspect.stack) <= 2).
Martin v. Löwis [Fri, 13 Apr 2001 08:09:50 +0000 (08:09 +0000)]
Patch #415777: new grouping strategy.
fixes bug #414940, and redoes the fix for #129417 in a different way.
It also fixes a number of other problems with locale-specific formatting:
If there is leading or trailing spaces, then no grouping should be applied
in the spaces, and the total length of the string should not be changed
due to grouping.
Also added test case which works only if the en_US locale is available.
Fred Drake [Fri, 13 Apr 2001 05:13:55 +0000 (05:13 +0000)]
Update the helper scripts that push development docs to SourceForge;
this version avoids having to build a separate authenticated connection
to push the update-docs.sh script to SF.
Fred Drake [Thu, 12 Apr 2001 22:07:27 +0000 (22:07 +0000)]
_synthesize(): Helper function: when the users passes a specific
value for the 'using' parameter of the get() function
or the BROWSER environment variable, if the thing
passed in is a path (as seems to be the case with KDE)
instead of a short name, examine the available
controllers to see if we can synthesize one based on a
pre-registered controller that shares the same base
name.
get(): If the user specifies a browser we don't know about, use
_synthesize() to attempt to create a usable controller.
Some small adjustments were needed in some of the browser classes to
support this.
Jeremy Hylton [Thu, 12 Apr 2001 21:04:43 +0000 (21:04 +0000)]
Use new _implicitNameOp() to generate name op code for list comprehensions.
Always emit a SET_LINENO 0 at the beginning of the module. The
builtin compiler does this, and it's much easier to compare bytecode
generated by the two compilers if they both do.
Move the SET_LINENO inside the FOR_LOOP block for list
comprehensions. Also for compat. with builtin compiler.
Fred Drake [Thu, 12 Apr 2001 20:26:49 +0000 (20:26 +0000)]
Added warning that FancyURLopener prompts the user on the terminal when
basic authentication is needed.
Added documentation for FancyURLopener.prompt_user_passwd(), explaining
that subclasses should provide more appropriate behavior for the hosting
environment.
Jeremy Hylton [Thu, 12 Apr 2001 20:21:39 +0000 (20:21 +0000)]
pyassem.py:
Fix annoying bugs in flow graph layout code. In some cases the
implicit control transfers weren't honored. In other cases,
JUMP_FORWARD instructions jumped backwards.
Remove unused arg from nextBlock().
pycodegen.py
Add optional force kwarg to set_lineno() that will emit a
SET_LINENO even if it is the same as the previous lineno.
Use explicit LOAD_FAST and STORE_FAST to access list comp implicit
variables. (The symbol table doesn't know about them.)
Tim Peters [Thu, 12 Apr 2001 18:38:48 +0000 (18:38 +0000)]
Bug 415514 reported that e.g.
"%#x" % 0
blew up, at heart because C sprintf supplies a base marker if and only if
the value is not 0. I then fixed that, by tolerating C's inconsistency
when it does %#x, and taking away that *Python* produced 0x0 when
formatting 0L (the "long" flavor of 0) under %#x itself. But after talking
with Guido, we agreed it would be better to supply 0x for the short int
case too, despite that it's inconsistent with C, because C is inconsistent
with itself and with Python's hex(0) (plus, while "%#x" % 0 didn't work
before, "%#x" % 0L *did*, and returned "0x0"). Similarly for %#X conversion.
Fred Drake [Thu, 12 Apr 2001 16:47:17 +0000 (16:47 +0000)]
Convert several \seetext references to \seerfc and \seetitle versions.
These format somewhat better and include more semantic information in the
source.
Properly qualify methods inherited from classes in other modules.
Fix so that docother() doesn't blow up.
Eliminate man() function since doc() and man() did nearly the same thing.
Various other code cleanup and refactoring to reduce duplication.
Simplify and rewrite freshimport() so modules are always up to date,
even within packages (where reload() doesn't work).
Add finalization callback to the server (so that if the server fails to
start for some reason, the main thread isn't left hanging).
Steve Purcell [Thu, 12 Apr 2001 09:05:01 +0000 (09:05 +0000)]
- New fail*() methods, and comprehensive set of assert*() synonyms
- TestCase.failureException defines the exception that indicates a test failure
- Docstrings for TestLoader class
- Added exc_info() hack back in