Python News
+++++++++++
-What's New in Python 3.2.3 release candidate 1?
-===============================================
+What's New in Python 3.3.0 Alpha 2?
+===================================
-*Release date: 24-Feb-2011*
+*Release date: XXXX-XX-XX*
+
+Core and Builtins
+-----------------
+
+- Issue #14205: dict lookup raises a RuntimeError if the dict is modified
+ during a lookup.
+
+Library
+-------
+
+- Issue #14168: Check for presence of Element._attrs in minidom before
+ accessing it.
+
+- Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
+ Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
+ for polling multiple objects at once. Patch by sbt.
+
+- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
+ data or close method) for the Python implementation as well.
+ Drop the no-op TreeBuilder().xml() method from the C implementation.
+
++Extension Modules
++-----------------
++
++- Issue #14212: The re module didn't retain a reference to buffers it was
++ scanning, resulting in segfaults.
++
+
+What's New in Python 3.3.0 Alpha 1?
+===================================
+
+*Release date: 05-Mar-2012*
Core and Builtins
-----------------
}
static void*
-getstring(PyObject* string, Py_ssize_t* p_length, int* p_charsize, Py_buffer *view)
+getstring(PyObject* string, Py_ssize_t* p_length,
- int* p_logical_charsize, int* p_charsize)
++ int* p_logical_charsize, int* p_charsize,
++ Py_buffer *view)
{
/* given a python object, return a data pointer, a length (in
characters), and a character size. return NULL if the object
return ptr;
}
- /* get pointer to string buffer */
+ /* get pointer to byte string buffer */
- view.len = -1;
+ view->len = -1;
buffer = Py_TYPE(string)->tp_as_buffer;
if (!buffer || !buffer->bf_getbuffer ||
- (*buffer->bf_getbuffer)(string, &view, PyBUF_SIMPLE) < 0) {
+ (*buffer->bf_getbuffer)(string, view, PyBUF_SIMPLE) < 0) {
PyErr_SetString(PyExc_TypeError, "expected string or buffer");
return NULL;
}
if (PyBytes_Check(string) || bytes == size)
charsize = 1;
-#if defined(HAVE_UNICODE)
- else if (bytes == (Py_ssize_t) (size * sizeof(Py_UNICODE)))
- charsize = sizeof(Py_UNICODE);
-#endif
else {
PyErr_SetString(PyExc_TypeError, "buffer size mismatch");
- return NULL;
+ goto err;
}
*p_length = size;
state->lastmark = -1;
state->lastindex = -1;
- ptr = getstring(string, &length, &logical_charsize, &charsize);
+ state->buffer.buf = NULL;
- ptr = getstring(string, &length, &charsize, &state->buffer);
++ ptr = getstring(string, &length, &logical_charsize, &charsize, &state->buffer);
if (!ptr)
- return NULL;
+ goto err;
- if (logical_charsize == 1 && pattern->logical_charsize > 1) {
- PyErr_SetString(PyExc_TypeError,
- if (charsize == 1 && pattern->charsize > 1) {
++ if (logical_charsize == 1 && pattern->logical_charsize > 1) {
+ PyErr_SetString(PyExc_TypeError,
- "can't use a string pattern on a bytes-like object");
+ "can't use a string pattern on a bytes-like object");
- return NULL;
- }
- if (logical_charsize > 1 && pattern->logical_charsize == 1) {
- PyErr_SetString(PyExc_TypeError,
+ goto err;
+ }
- if (charsize > 1 && pattern->charsize == 1) {
++ if (logical_charsize > 1 && pattern->logical_charsize == 1) {
+ PyErr_SetString(PyExc_TypeError,
- "can't use a bytes pattern on a string-like object");
+ "can't use a bytes pattern on a string-like object");
- return NULL;
- }
+ goto err;
+ }
/* adjust boundaries */
if (start < 0)
int status;
Py_ssize_t n;
Py_ssize_t i, b, e;
- int bint;
+ int logical_charsize, charsize;
int filter_is_callable;
+ Py_buffer view;
if (PyCallable_Check(ptemplate)) {
/* sub/subn takes either a function or a template */
} else {
/* if not callable, check if it's a literal string */
int literal;
- ptr = getstring(ptemplate, &n, &logical_charsize, &charsize);
+ view.buf = NULL;
- ptr = getstring(ptemplate, &n, &bint, &view);
- b = bint;
++ ptr = getstring(ptemplate, &n, &logical_charsize, &charsize, &view);
+ b = charsize;
if (ptr) {
- if (b == 1) {
- literal = sre_literal_template((unsigned char *)ptr, n);
- } else {
-#if defined(HAVE_UNICODE)
- literal = sre_uliteral_template((Py_UNICODE *)ptr, n);
-#endif
- }
+ literal = sre_literal_template(b, ptr, n);
} else {
PyErr_Clear();
literal = 0;
return NULL;
}
- if (pattern == Py_None)
+ if (pattern == Py_None) {
+ self->logical_charsize = -1;
self->charsize = -1;
+ }
else {
Py_ssize_t p_length;
- if (!getstring(pattern, &p_length, &self->charsize, &self->view)) {
+ if (!getstring(pattern, &p_length, &self->logical_charsize,
- &self->charsize)) {
++ &self->charsize, &self->view)) {
Py_DECREF(self);
return NULL;
}