| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed by Amaury.
|
|
|
|
|
|
|
|
| |
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.
Closes issue 3781.
Review by Benjamin Peterson.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Surprising behaviour of the "$" regexp: it matches the
end of the string, AND just before the newline at the end
of the string::
re.sub('$', '#', 'foo\n') == 'foo#\n#'
Python is consistent with Perl and the pcre library, so
we just document it.
Guido prefers "\Z" to match only the end of the string.
|
|
|
|
|
| |
Regular Expression inline flags not handled correctly for some unicode
characters. (Forward port from 2.5.2.)
|
|
|
|
| |
compiled regexes.
|
|
|
|
|
|
|
|
|
| |
Make sure the type of the return value of re.sub(x, y, z) is the type
of y+x (i.e. unicode if either is unicode, str if they are both str)
even if there are no substitutions or if x==z (which triggered various
special cases in join_list()).
Could be backported to 2.5; no need to port to 3.0.
|
|
|
|
|
|
|
|
| |
test.test_support.catch_warning is more full-featured and provides the same
functionality.
Since guard_warnings_filter was added in 2.6 there is no
backwards-compatibility issues.
|
|
|
|
| |
You might want to review this change as it's my first time. Be gentle. :-)
|
| |
|
|
|
|
| |
now be unpickled. Will backport.
|
| |
|
|
|
|
| |
considering it exactly like a '*'.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
empty final matches with finditer(). New test cases included
for this bug and for #581080.
|
|
|
|
| |
some escaping bugs in SRE.
|
| |
|
|
|
|
| |
Backported to 2.3.
|
|
|
|
|
| |
a string or unicode object in sre.compile() when a different type
pattern with the same value exists.
|
| |
|
| |
|
|
|
|
|
|
| |
Use isinstance() instead of comparing types directly, to enable
subclasses of str and unicode to be used as patterns.
Blessed by /F.
|
| |
|
|
|
|
|
|
| |
From gcov's output (based on a locally changed _sre.c):
82.07% of 1372 source lines executed in file ./Modules/_sre.c
|
|
|
|
|
|
|
|
|
|
| |
and test_support.run_classtests() into run_unittest()
and use it wherever possible.
Also don't use "from test.test_support import ...", but
"from test import test_support" in a few spots.
From SF patch #662807.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This problem is related to a wrong behavior from mark_save/restore(),
which don't restore the mark_stack_base before restoring the marks.
Greg's suggestion was to change the asserts, which happen to be
the only recursive ops that can continue the loop, but the problem would
happen to any operation with the same behavior. So, rather than
hardcoding this into asserts, I have changed mark_save/restore() to
always restore the stackbase before restoring the marks.
Both solutions should fix these two cases, presented by Greg:
>>> re.match('(a)(?:(?=(b)*)c)*', 'abb').groups()
('b', None)
>>> re.match('(a)((?!(b)*))*', 'abb').groups()
('b', None, None)
The rest of the bug and patch in #725149 must be discussed further.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
within repeats of alternatives. The only change to the original
patch was to convert the tests to the new test_re.py file.
This patch fixes cases like:
>>> re.match('((a)|b)*', 'abc').groups()
('b', '')
Which is wrong (it's impossible to match the empty string),
and incompatible with other regex systems, like the following
examples show:
% perl -e '"abc" =~ /^((a)|b)*/; print "$1 $2\n";'
b a
% echo "abc" | sed -r -e "s/^((a)|b)*/\1 \2|/"
b a|c
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
RuntimeError.
|
| |
|
|
|
|
|
|
|
|
| |
imports of test modules now import from the test package. Other
related oddities are also fixed (like DeprecationWarning filters that
weren't specifying the full import part, etc.). Also did a general
code cleanup to remove all "from test.test_support import *"'s. Other
from...import *'s weren't changed.
|
|
|
|
|
|
|
|
|
|
|
| |
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
|
| |
|
|
|
|
| |
strings/patterns.
|
|
|
|
| |
(This one was trivial -- no actual string. references in it!)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
|
| |
|
| |
|
|
|
|
|
| |
-- added basic unicode tests to test_re
-- added test case for Sjoerd's xmllib problem to re_tests
|
| |
|
| |
|
| |
|
|
|
|
|
| |
is actually by Fredrik Lundh). This will break the re tests --
Fredrik will fix this before the final release.
|
|
|
|
|
| |
Added test for m.groups() with default.
Added a few prints announcing various tests in verbose mode.
|