no don't have to start with underscore.
- Add spaces after commas in argument lists.
- Only test dbhash if bsddb can be imported. (Wonder if there are
more like this?)
pythonrun.c: In Py_Finalize, don't reset the initialized flag until after
the exit funcs have run.
atexit.py: in _run_exitfuncs, mutate the list of pending calls in a
threadsafe way. This wasn't a contributor to bug 128475, it just burned
my eyeballs when looking at that bug.
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
created by Andrew's setup.py script, *if* we're actually running from
the build directory. (The test for that: whether the sys.path[-1]
ends in "/Modules".)
This has one disadvantage: it imports a fair amount of code from the
distutils package, just in order to be able to calculate the correct
pathname. See if I care. :-)
(I realize that I didn't really test this, because all the tests
succeed, so verify() never raised an AssertionError -- but the test
suite still succeeds, so I'm not too worried.)
This patch adds support for Cygwin to util.get_platform(). A Cygwin
specific case is needed due to the format of Cygwin's uname command,
which contains '/' characters.
implementation details inside the ucnhash module.
also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...
when quoting forbidden characters. There are scripts out there that
break with lower case, therefore I guess %%%X should be used."
I agree, so am fixing this.
for SocketServer.py (inherited by TCPServer)
Luke wrote:
The socketserver code, with a little bit of tweaking, can be made
sufficiently general to service "requests" of any kind, not just by sockets.
The BaseServer class was created, for example, to poll a table in a MYSQL
database every 2 seconds. each entry in the table can be allocated a
Handler which deals with the entry.
With this patch, using BaseServer and ThreadedServer classes, the creation
of the server that reads and handles MySQL table entries instead of a
socket was utterly trivial: about 50 lines of python code.
You may consider this code to be utterly useless [why would anyone else
want to do anything like this???] - you are entitled to your opinion. if you
think so, then think of this: have you considered how to cleanly add SSL to
the TCPSocketServer? What about using shared memory as the
communications mechanism for a server, instead of sockets? What about
communication using files?
The SocketServer code is extremely good every useful. it's just that as it
stands, it is tied to sockets, which is not as useful.
I heartily approve of this idea.
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
except that it always returns Unicode objects.
A new C API PyObject_Unicode() is also provided.
This closes patch #101664.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
sys.prefix + 'config/Makefile'. When building Python for the first
time, these files aren't there, so the files from the build tree have
to be used instead; this file adds an entry point for specifying that
the build tree files should be used. (Perhaps 'set_python_build' should
should be preceded with an underscore?)
__getattr__() method, which clearly (like the other methods) was
intended to pass the __getattr__() call on to the self.err object,
mistakenly returned getattr(self, self.err) rather than
getattr(self.err, attr). Since self.err is not a string, this always
raises a TypeError. Apparently that doesn't bother for the one
attribute for which __getattr__() is actually called ('__coerce__'),
but it broke the rich comparisons stuff that I'm trying to get into
shape, so I'm fixing this now. (I could also simply remove the
__getattr__() method, but fixing it seems more in the spirit of what
the ComparableException class is trying to do.)
for done[n] can be integers as well as strings, but the code
concatenates them with strings (fixed by adding a str()) and calls
string.strip() on them (fixed by rearranging the logic)
(Presumably this wasn't noticed previously because parse_makefile()
was only called on Modules/Makefile, which contains no integer-valued
variables.)
produce a list of unique filenames:
"While attempting to build an RPM using distutils on Python 2.0,
rpm complained about duplicate files. The following patch fixed
that problem.
in case the parameters are out of bounds and fixes error handling
for .count(), .startswith() and .endswith() for the case of
mixed string/Unicode objects.
This patch adds Python style index semantics to PyUnicode_Count()
indices (including the special handling of negative indices).
The patch is an extended version of patch #103249 submitted
by Michael Hudson (mwh) on SF. It also includes new test cases.
message, and tries to make the messages more consistent and helpful when
the wrong number of arguments or duplicate keyword arguments are supplied.
Comes with more tests for test_extcall.py and and an update to an error
message in test/output/test_pyexpat.
uppercase strings also when the IGNORECASE flag is set (bug #128899)
(also added test cases for recently fixed bugs to the regression suite
-- or in other words, check in re_tests.py too...)
This is slightly controversial, but after reading the argumentation in
the bug tracker for and against, I believe this is the right solution.
Let me know if it breaks for you, and how.
(bugs #115903, #115696)
This is based on a patch by Darrel Gallion. I'm not 100%
sure about this fix, but I haven't managed to come up with
any test case it cannot handle...
Ping apparently doesn't check in Accepted patches, so I'm doing this
for him.
According to Ping: The name of the controller class should be
"Konqueror", not "Konquerer". (See the website
http://www.konqueror.org/.)
Header
Dougfort's comments: httplib does not include ':port ' in the HTTP 1.1
'Host:' header. This causes problems if the server is not listening
on Port 80. The test case I use is the login to /manage under Zope,
with Zope listening on port 8080. Zope returns a <frameset> with the
<frame> source URLs lacking the :8080.
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
had already been fixed by AMK)
appends to list of filters instead of inserting at the front. This
is useful to add a filter with a lower priority than -W options.
- Cosmetic improvements to a docstring and an error message.
The ASCII-art diagram at the top of httplib contains a backslash at
the end of a line, which causes Python to remove the newline. This
one-character patch adds a space after the backslash so it will
appear at the end of the line in the docstring as intended.
pid across threads (but in that case, it's still the same process, and so
still sharing the "template" cache in tempfile.py). Repaired that, and
added a new std test.
On Linux, someone please run that standalone with more files and/or more
threads; e.g.,
python lib/test/test_threadedtempfile.py -f 1000 -t 10
to run with 10 threads each creating (and deleting) 1000 temp files.
Tested on Windows. Should be tested on Linux. Should also be
tested on some platform without threads (I simulated that by
making the "import thread" fail, but that's not the same as
actually doing it!).
with spaces in filename.
I changed the module to use string methods instead of the string
module. Also, instead of stripping the last character of the filename
(assuming this is the linefeed), I strip trailing whitespace (assuming
creating files with trailing whitespace in their name cannot possibly
be a wise idea).
(Note that I believe that /F's "workaround for broken uuencoders" is
no longer needed since the recent fix to binascii.c, but I'll leave it
in since it appears pretty harmless.)
codec to test all charmap codec features.
As side-effect of moving the test codec into a new module, the encodings
package codec import mechanism is checked as well.
Wasn't built on Windows; not in config.c either.
Module init function missing DL_EXPORT magic.
test_xreadline output file obviously wrong (started w/ "test_xrl").
test program very unclear about what was expected.
variant that never needs to "search from the right".
Also fixed unlikely memory leak in get_line, if string size overflows INTMAX.
Also new std test test_bufio to make sure .readline() works.
the mapping dictionaries can now contain 1-n mappings, meaning
that character ordinals may be mapped to strings or Unicode object,
e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by
the complete string or Unicode object instead of just one character.
Another feature introduced by the patch is that of mapping oridnals to
the emtpy string. This allows removing characters.
The patch is different from patch #103100 in that it does not cause a
performance hit for the normal use case of 1-1 mappings.
Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
the urljoin() function, which exercises the urlparse() and urlunparse()
functions as side effects.
(Moshe, why did we have perfectly empty tests checked in for this?)
urljoin(): Make this conform to RFC 1808 for all examples given in that
RFC (both "Normal" and "Abnormal"), so long as that RFC does
not conflict the older RFC 1630, which also specified
relative URL resolution.
This closes SF bug #110832 (Jitterbug PR#194).
an empty keywords dictionary (via apply() or the extended call syntax),
the keywords dict should be ignored. If the keywords dict is not empty,
TypeError should be raised. (Between the restructuring of the call
machinery and this patch, an empty dict in this situation would trigger
a SystemError via PyErr_BadInternalCall().)
Added regression tests to detect errors for this.
codec to not apply Latin-1 mappings for keys which are not found
in the mapping dictionaries, but instead treat them as undefined
mappings.
The patch was originally written by Martin v. Loewis with some
additional (cosmetic) changes and an updated test script
by Marc-Andre Lemburg.
The standard codecs were recreated from the most current files
available at the Unicode.org site using the Tools/scripts/gencodec.py
tool.
This patch closes the bugs #116285 and #119960.
1. When running in verbose mode, if any test happens to pass, print
a warning that the apparent success may be bogus (stdout isn't
compared in verbose mode). Been fooled by that too often.
2. When a test fails because the expected stdout doesn't match the
actual stdout, print as much of stdout as did match before the
first failing write. Else we get failures of the form "expected
'a', got 'b'" and a glance at the expected output file shows
500 instances of 'a' -- no idea where it failed, and, as in #1,
trying to run in verbose mode instead doesn't help because
stdout isn't compared then.