| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
as documented. The pattern and source keyword parameters are left as
deprecated aliases.
|
| |
|
|
|
|
| |
the _sre moduel.
|
| |
|
|
|
|
| |
in the re module. Patch by Nickolai Zeldovich.
|
|
|
|
| |
non-greedy repeat. Patch by Matthew Barnett.
|
|
|
|
|
| |
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
|
| |
|
| |
|
|
|
|
| |
Patch by Anton Kasyanov.
|
|
|
|
| |
Found by Clang trunk's Undefined-Behavior Sanitizer. [more to come]
|
|
|
|
| |
Patch by Serhiy Storchaka.
|
|
|
|
| |
Patch by Serhiy Storchaka.
|
| |
|
|
|
|
| |
This closes #12099.
|
|
|
|
| |
Found using Clang's static analyzer.
|
| |
|
|
|
|
| |
argument values in debug mode. Patch by Victor Stinner.
|
|
|
|
|
| |
category [No]; only those of category [Nd]. (Backport of r74237
from py3k.)
|
|
|
|
| |
Reviewed by Amaury.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a verifier for the binary code used by the _sre module (this
is often called bytecode, though to distinguish it from Python bytecode
I put it in quotes).
I wrote this for Google App Engine, and am making the patch available as
open source under the Apache 2 license. Below are the copyright
statement and license, for completeness.
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
It's not necessary to include these copyrights and bytecode in the
source file. Google has signed a contributor's agreement with the PSF
already.
|
|
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
SRE_MATCH so that signal handlers can be invoked during
long regular expression matches. It also adds a new
error return value indicating that an exception
occurred in a signal handler during the match, allowing
exceptions in the signal handler to propagate up to the
main loop. Thanks Josh Hoyt and Ralf Schmitt.
|
|
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
|
|
|
|
|
|
| |
add 'if (PyErr_Occurred())' checks to various places so that NULL is
returned properly.
2.4 backport candidate.
|
|
|
|
|
|
| |
There might be something else we need to do to handle the exception.
Klocwork # 212-213
|
| |
|
|
|
|
| |
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
|
| |
|
| |
|
|
|
|
| |
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
|
| |
|
|
|
|
| |
with the getstring() results in pattern_subx. Will come back to that.
|
| |
|
|
|
|
|
| |
All of these (except _lsprof.c) should be backported. Particularly
the hotshot change which validates sys.path. Can someone backport?
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loses information:
OverflowError: regular expression code size limit exceeded
Otherwise the compiled code is gibberish, possibly leading at
least to wrong results or (as reported on c.l.py) internal
sre errors at match time.
I'm not sure how to test this. SRE_CODE is a 2-byte type on
my box, and it's easy to create a regexp that causes the new
exception to trigger here. But it may be a 4-byte type on
other boxes, and creating a regexp large enough to trigger
problems there would be pretty crazy.
Bugfix candidate.
|
|
|
|
| |
Probably should be backported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
| |
|
| |
|
|
|
|
|
| |
empty final matches with finditer(). New test cases included
for this bug and for #581080.
|
|
|
|
| |
modules and objects.
|
| |
|
| |
|