Tim Peters [Thu, 14 Oct 2004 04:16:54 +0000 (04:16 +0000)]
remove_stderr_debug_decorations(): Always try the substitution. Else
this test failed under the combination of passing -O to a debug-build
Python. Now all 4 of those pass ({debug, release} x {-O, no -O}).
Anthony Baxter [Wed, 13 Oct 2004 15:54:17 +0000 (15:54 +0000)]
Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)
Anthony Baxter [Wed, 13 Oct 2004 12:35:28 +0000 (12:35 +0000)]
Backing out the basic dependency checking (from pycon sprint).
This support was only a first cut, and doesn't deserve to be in
a released version (where we have to support it in an ongoing
manner)
Tim Peters [Wed, 13 Oct 2004 04:07:12 +0000 (04:07 +0000)]
New helper remove_stderr_debug_decorations(). This test passes in a
debug build on Windows now. More applications of the helper may be needed
on non-Windows platforms.
Tim Peters [Wed, 13 Oct 2004 03:43:40 +0000 (03:43 +0000)]
Kill several problems at once: test_poll() failed sometimes for me.
Turns out the mysterious "expected output" file contained exactly N dots,
because test_poll() has a loop that *usually* went around N times,
printing one dot on each loop trip. But there's no guarantee of that,
because the exact value of N depended on the vagaries of scheduling
time.sleep()s across two different processes. So stopped printing dots,
and got rid of the expected output file. Add a loop counter instead,
and verify that the loop goes around at least a couple of times. Also
cut the minimum time needed for this test from 4 seconds to 1.
Tim Peters [Wed, 13 Oct 2004 03:29:54 +0000 (03:29 +0000)]
test_stdout_none(): Don't print "banana" to the screen in the middle
of the test. It's testing stdout in a different process, so it has to
print something, but I didn't find "banana" to be self-explanatory.
Tim Peters [Wed, 13 Oct 2004 03:21:35 +0000 (03:21 +0000)]
Windows test_creationflags() test: print msg to stderr informing the
tester that a DOS box is expected to flash. Slash the sleep from 2
seconds to a quarter second (why would we want to wait 2 seconds just
to stare at a DOS box?).
Tim Peters [Wed, 13 Oct 2004 03:14:40 +0000 (03:14 +0000)]
XXX about extreme expense of test_no_leaking() on Windows. I'm not sure
what this is trying to do. If it's necessary for it to create > 1000
processes, it should be controlled by a new resource and not run by
default on Windows.
Tim Peters [Tue, 12 Oct 2004 22:29:54 +0000 (22:29 +0000)]
Experience with Zope2's tests showed it's a Bad Idea to make unittest
display a test's docstring as "the name" of the test. So changed most
test docstrings to comments, and removed the clearly useless ones. Now
unittest reports the actual names of the test methods.
* Use fresh copy of globals/locals so the script being debugged can't access
the pdb namespace (e.g.: p line_prefix will no longer work).
* Remove pdb.py's path from sys.path. Having it in there is normally not a
problem, but it could prove irritating when messing with PYTHONPATH or
invoking pdb via /usr/bin/pdf.
* You can now set a breakpoint on the script being debugged, even if the script
doesn't end with a '.py' extension. Also, setting breakpoints with absolute
paths now works reliably.
Enhancements:
* Go directly to the first line of the script.
* Enter post-mortem debugging if the script being debugged doesn't catch an
exception.
* Restart the script being debugged and preserve debugger state when the script
being debugged exits.
Cleanup:
* Moved the __main__ method into a main() function.
* Kill the (undocumented, not in __all__) mainmodule/mainpyfile globals, add a
mainpyfile attribute to pdb.
Document that on Unix, the 'cmd' argument to the os.popen2/3/4 and
popen2.popen2/3/4 functions can be a sequence. All texts are a variation on the
following:
On \UNIX, \var{cmd} may be a sequence, in which case arguments will be passed
directly to the program without shell intervention (as with
\function{os.spawnv()}). If \var{cmd} is a string it will be passed to the shell
(as with \function{os.system()}).
Anthony Baxter [Mon, 11 Oct 2004 13:53:08 +0000 (13:53 +0000)]
Added a usegmt flag to email.Utils.formatdate - this allows it to be
used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must
be the timezone string).
Tim Peters [Mon, 11 Oct 2004 02:40:51 +0000 (02:40 +0000)]
SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by Nick
Coghlan, for determining whether PyEval_InitThreads() has been called.
Also purged the undocumented+unused _PyThread_Started int.
Tim Peters [Sun, 10 Oct 2004 05:30:40 +0000 (05:30 +0000)]
Revert rev 2.35. It was based on erroneous reasoning -- the current
thread's id can't get duplicated, because (of course!) the current thread
is still running. The code should work either way, but reverting the
gratuitous change should make backporting easier, and gets the bad
reasoning out of 2.35's new comments.
Tim Peters [Sat, 9 Oct 2004 23:55:36 +0000 (23:55 +0000)]
PyGILState_Release(): If we need to delete the TLS entry for this thread,
that must be done under protection of the GIL, for reasons explained in
new comments.
Barry Warsaw [Sat, 9 Oct 2004 23:00:11 +0000 (23:00 +0000)]
Fix SF bug # 1030941. In _parsegen(), in the clause where we're
capturing_preamble but we found a StartBoundaryNotFoundDefect, we need to
consume all lines from the current position to the EOF, which we'll set as the
epilogue of the current message. If we're not at EOF when we return from
here, the outer message's capturing_preamble assertion will fail.
Tim Peters [Sat, 9 Oct 2004 22:47:13 +0000 (22:47 +0000)]
_PyGILState_Init(), PyGILState_Ensure(): Since PyThread_set_key_value()
can fail, check its return value, and die if it does fail.
_PyGILState_Init(): Assert that the thread doesn't already have an
association for autoTLSkey. If it does, PyThread_set_key_value() will
ignore the attempt to (re)set the association, which the code clearly
doesn't want.
Tim Peters [Sat, 9 Oct 2004 22:33:09 +0000 (22:33 +0000)]
Document the results of painful reverse-engineering of the "portable TLS"
code.
PyThread_set_key_value(): It's clear that this code assumes the passed-in
value isn't NULL, so document that it must not be, and assert that it
isn't. It remains unclear whether existing callers want the odd semantics
actually implemented by this function.
Barry Warsaw [Sat, 9 Oct 2004 21:08:30 +0000 (21:08 +0000)]
__init__(): Coerce the input_charset to unicode (with ascii encoding) before
calling .lower() on it. This fixes the problem described in SF patch # 866982
where in the tr_TR.ISO-8859-9 locale, 'I'.lower() isn't 'i'. unicodes are
locale insensitive.
The shutils.rmtree() implementation uses an excessive amount of memory when
deleting large directory hierarchies. Before actually deleting any files, it
builds up a list of (function, filename) tuples for all the files that it is
going to remove.
David Goodger [Sun, 3 Oct 2004 15:55:09 +0000 (15:55 +0000)]
SF bug #997050: Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work.
David Goodger [Sun, 3 Oct 2004 15:40:25 +0000 (15:40 +0000)]
SF bug #1017864: ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options.