python-dev Summary for 2006-10-16 through 2006-10-31

steven.bethard at steven.bethard at
Mon Nov 27 05:47:23 CET 2006

python-dev Summary for 2006-10-16 through 2006-10-31

.. contents::

[The HTML version of this Summary is available at]


Roundup to replace SourceForge tracker

Roundup_ has been named as the official replacement for the SourceForge_ issue tracker. Thanks go out to the new volunteer admins, Paul DuBois, Michael Twomey, Stefan Seefeld, and Erik Forsberg, and also to `Upfront Systems`_ who will be hosting the tracker. If you'd like to provide input on what the new tracker should do, please join the `tracker-discuss mailing list`_.

.. _SourceForge:
.. _Roundup:
.. _Upfront Systems:
.. _tracker-discuss mailing list:

Contributing threads:

- `PSF Infrastructure has chosen Roundup as the issue tracker for Python development <>`__
- `Status of new issue tracker <>`__


The buffer protocol and communicating binary format information

Travis E. Oliphant presented a pre-PEP for adding a standard way to describe the shape and intended types of binary-formatted data. It was accompanied by a pre-PEP for extending the buffer protocol to handle such shapes and types. Under the proposal, a new ``datatype`` object would describe binary-formatted data with an API like::

    datatype((float, (3,2))
    # describes a 3*2*8=48 byte block of memory that should be interpreted
    # as 6 doubles laid out as arr[0,0], arr[0,1], ... a[2,0], a[1,2]

    datatype([( ([1,2],'coords'), 'f4', (3,6)), ('address', 'S30')])
    # describes the structure
    #     float coords[3*6]   /* Has [1,2] associated with this field */
    #     char  address[30]

Alexander Belopolsky provided a nice example of why you might want to extend the buffer protocol along these lines. Currently, there's not much you can do with a basic buffer object. If you want to pass it to numpy_, you have to provide the type and shape information yourself::

    >>> b = buffer(array('d', [1,2,3]))
    >>> numpy.ndarray(shape=(3,), dtype=float, buffer=b)
    array([ 1.,  2.,  3.])

By extending the buffer protocol appropriately so that the necessary information can be provided, you should be able to pass the buffer directly to numpy_ and have it understand the format itself::

    >>> numpy.array(b)

People were uncomfortable with the many ``datatype`` variants -- the constructor accepted types, strings, lists or dicts, each of which could specify the structure in a different way. Also, a number of people questioned why the existing ``ctypes`` mechanisms for describing binary data couldn't be used instead, particularly since ``ctypes`` could already describe things like function pointers and recursive types, which the pre-PEP could not. Travis said he was looking for a way to unify the data formats of all the ``array``, ``struct``, ``numpy`` and ``ctypes`` modules, and felt like using the ``ctypes`` approach was too verbose for use in the other modules. In particular, he felt like the ``ctypes`` use of type objects as binary-format specifiers was problematic because type objects were harder to manipulate at the C level.

The discussion continued on into the next fortnight.

.. _numpy:

Contributing threads:

- `PEP: Adding data-type objects to Python <>`__
- `PEP: Extending the buffer protocol to share array information. <>`__

The "lazy strings" patch

Discussion continued on Larry Hastings `lazy strings patch`_ that would have delayed until necessary the evaluation of some string operations, like concatenation and slicing. With his patch, repeated string concatenation could be used instead of the standard ``.join()`` idiom, and slices which were never used would never be rendered. Discussions of the patch showed that people were concerned about memory increases when a small slice of a very large string kept the large string around in memory. People also felt like a stronger motivation was necessary to justify complicating the string representation so much. Larry was pointed to some `code that his patch would break`_, which was using ``ob_sval`` directly instead of calling ``PyString_AS_STRING()`` like it was supposed to. He was also referred to the `Python 3000 list`_ where the recent discussions of `string views`_ would be relevant, and his proposal might have a better chance of acceptance.

.. _lazy strings patch:
.. _code that his patch would break:
.. _Python 3000 list:
.. _string views:

Contributing threads:

- `PATCH submitted: Speed up + for string Re: PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiom <>`__
- `Python-Dev Digest, Vol 39, Issue 54 <>`__
- `Python-Dev Digest, Vol 39, Issue 55 <>`__
- `The "lazy strings" patch [was: PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiom] <>`__
- `The "lazy strings" patch <>`__

PEP 355 status

BJorn Lindqvist wanted to wrap up the loose ends of `PEP 355`_ and asked whether the problem was the specific path object of `PEP 355`_ or path objects in general. A number of people felt that some reorganization of the path-related functions could be helpful, but that trying to put everything into a single object was a mistake. Some important requirements for a reorganization of the path-related functions:

* should divide the functions into coherent groups
* should allow you to manipulate paths foreign to your OS

There were a few suggestions of possible new APIs, but no concrete implementations. People seemed hopeful that the issue could be resurrected for Python 3K, but no one appeared to be taking the lead.

.. _PEP 355:

Contributing thread:

- `PEP 355 status <>`__

Buildbots, configure changes and extension modules

Grig Gheorghiu, who's been taking care of the `Python Community Buildbots`_, noticed that the buildbots started failing after a checkin that made changes to ``configure``. Martin v. Lowis explained that even though a plain ``make`` will trigger a re-run of ``configure`` if it has changed, there is an issue with distutils not rebuilding when header files change, and so extension modules are sometimes not rebuilt. Contributions to fix that deficiency in distutils are welcome.

Martin also pointed out a handy way of forcing a buildbot to start with a clean build: ask the buildbot to build a non-existing branch. This causes the checkouts to be deleted and the build to fail. The next regular build will then start from scratch.

.. _Python Community Buildbots:

Contributing thread:

- `Python unit tests failing on Pybots farm <>`__

Sqlite versions

Skip Montanaro ran into some problems running ``test_sqlite`` on OSX where he was getting a bunch of ``ProgrammingError: library routine called out of sequence`` errors. These errors appeared reliably when ``test_sqlite`` was run immediately after ctypes' ``test_find``. When he started linking to sqlite 3.1.3 instead of sqlite 3.3.8, the problems went away. Barry Warsaw mentioned that he had run into similar troubles when he tried to upgrade from 3.2.1 to 3.2.8.

Contributing thread:

- `Massive test_sqlite failure on Mac OSX ... sometimes <>`__

Threads, generators, exceptions and segfaults

Mike Klaas managed to `provoke a segfault`_ in Python 2.5 using threads, generators and exceptions. Tim Peters was able to whittle Mike's problem down to a relatively simple test case, where a generator was created within a thread, and then the thread vanished before the generator had exited. The segfault was a result of Python's attempt to clean up the abandoned generator, during which it tried to access the generator's already free()'d thread state. No clear solution to this problem had been decided on at the time of this summary.

.. _provoke a segfault:

Contributing thread:

- `Segfault in python 2.5 <>`__

ctypes and win64

Previously, Thomas Heller had asked that ctypes be removed from the Python 2.5 win64 MSI installers since it did not work for that platform at the time. Since then, Thomas integrated some patches in the trunk so that _ctypes could be built for win64/AMD64. Backporting these fixes to Python 2.5 would have meant that, while the MSI installer would still not include it, _ctypes could be built from a source distribution on win64/AMD64. It was unclear whether this would constitute a bugfix (in which case the backport would be okay) or a feature (in which case it wouldn't).

Contributing thread:

- `ctypes and win64 <>`__

Python 2.3.X and 2.4.X retired

Anthony Baxter pushed out a Python 2.4.4 release and was pushing out the Python 2.3.6 source release as well. He indicated that once 2.3.6 was out, both of these branches could be officially retired.

Contributing thread:

- `state of the maintenance branches <>`__

Producing bytecode from Python 2.5 ASTs

Michael Spencer offered up his compiler2_ module, a rewrite of the compiler module which allows bytecode to be produced from ``_ast.AST`` objects. Currently, it produces almost identical output to ``__builtin__.compile`` for all the stdlib modules and their tests. He asked for feedback on what would be necessary to get it stdlib ready, but had no responses.

.. _compiler2:

Contributing thread:

- `Fwd: Re: ANN compiler2 : Produce bytecode from Python 2.5 AST <>`__

Previous Summaries
- `Python 2.5 performance <>`__
- `Promoting PCbuild8 (Was: Python 2.5 performance) <>`__
- `2.3.6 for the unicode buffer overrun <>`__
- `2.4.4: backport classobject.c HAVE_WEAKREFS? <>`__

Skipped Threads
- `Weekly Python Patch/Bug Summary <>`__
- `Problem building module against Mac Python 2.4 and Python 2.5 <>`__
- ` down <>`__
- `BRANCH FREEZE release24-maint, Wed 18th Oct, 00:00UTC <>`__
- `who is interested on being on a python-dev panel at PyCon? <>`__
- `RELEASED Python 2.4.4, Final. <>`__
- `Nondeterministic long-to-float coercion <>`__
- `Promoting PCbuild8 <>`__
- `OT: fdopen on Windows question <>`__
- `Modulefinder <>`__
- `Optional type checking/pluggable type systems for Python <>`__
- `readlink and unicode strings (SF:1580674) Patch fixes readlink's behaviour w.r.t. Unicode strings: without this patch this function uses the system default encoding instead of the filesystem encoding to convert Unicode objects to plain strings. Like os.listdir, os.readlink will now return a Unicode object when the argument is a Unicode object. What I'd like to know is if this can be backported to the 2.5 branch. The first part of this patch (use filesystem encoding instead of the system encoding) is IMHO a bugfix, the second part might break existing applications (that might not expect a unicode result from os.readlink). The reason I did this patch is that os.path.realpath currently breaks when the path is a unicode string with non-ascii characters and at least one element of the path is a symlink. Ronald <>`__
- `readlink and unicode strings (SF:1580674) <>`__
- `RELEASED Python 2.3.6, release candidate 1 <>`__
- `__str__ bug? <>`__
- `Hunting down configure script error <>`__
- `Python 2.4.4 docs? <>`__
- `DRAFT: python-dev summary for 2006-09-01 to 2006-09-15 <>`__
- `DRAFT: python-dev summary for 2006-09-16 to 2006-09-30 <>`__
- `[Python-checkins] r52482 - in python/branches/release25-maint: Lib/ Lib/ Misc/NEWS <>`__
- ` scan of Python 2.5 source code <>`__
- `build bots, log output <>`__
- `PyCon: proposals due by Tuesday 10/31 <>`__
- `test_codecs failures <>`__


This is a summary of traffic on the `python-dev mailing list`_ from
October 16, 2006 through October 31, 2006.
It is intended to inform the wider Python community of on-going
developments on the list on a semi-monthly basis.  An archive_ of
previous summaries is available online.

An `RSS feed`_ of the titles of the summaries is available.
You can also watch comp.lang.python or comp.lang.python.announce for
new summaries (or through their email gateways of python-list or
python-announce, respectively, as found at

This python-dev summary is the 15th written by 
Steve Bethard. 

To contact me, please send email:

- Steve Bethard (steven.bethard at

Do *not* post to comp.lang.python if you wish to reach me.

The `Python Software Foundation`_ is the non-profit organization that
holds the intellectual property for Python.  It also tries to advance
the development and use of Python.  If you find the python-dev Summary
helpful please consider making a donation.  You can make a donation at .  Every cent counts so even a
small donation with a credit card, check, or by PayPal helps.

Commenting on Topics

To comment on anything mentioned here, just post to
`comp.lang.python`_ (or email python-list at which is a
gateway to the newsgroup) with a subject line mentioning what you are
discussing.  All python-dev members are interested in seeing ideas
discussed by the community, so don't hesitate to take a stance on
something.  And if all of this really interests you then get involved
and join `python-dev`_!

How to Read the Summaries

This summary is written using reStructuredText_. Any unfamiliar
punctuation is probably markup for reST_ (otherwise it is probably
regular expression syntax or a typo :); you can safely ignore it.  We
do suggest learning reST, though; it's simple and is accepted for
`PEP markup`_ and can be turned into many different formats like HTML
and LaTeX.

.. _python-dev:
.. _python-dev mailing list:
.. _comp.lang.python:
.. _PEP Markup:

.. _reST:
.. _reStructuredText:
.. _Python Software Foundation:

.. _archive:
.. _RSS feed:

More information about the Python-list mailing list