A release of repoze.bfg 0.7.0 was placed in the "lemonade" index at
http://dist.repoze.org/lemonade/dev . This version fixes a few bugs and has
major backwards incompatibility, which is described below (as well as a method
to preserve the old behavior):
- Fix a bug in ``repoze.bfg.wsgi.HTTPException``: the content length
was returned as an int rather than as a string.
- Add explicit dependencies on ``zope.deferredimport``,
``zope.deprecation``, and ``zope.proxy`` for forward compatibility
reasons (``zope.component`` will stop relying on
``zope.deferredimport`` soon and although we use it directly, it's
only a transitive dependency, and ''zope.deprecation`` and
``zope.proxy`` are used directly even though they're only transitive
dependencies as well).
- Using ``model_url`` or ``model_path`` against a broken model graph
(one with models that had a non-root model with a ``__name__`` of
``None``) caused an inscrutable error to be thrown: ( if not
``_must_quote[cachekey].search(s): TypeError: expected string or
buffer``). Now URLs and paths generated against graphs that have
None names in intermediate nodes will replace the None with the
empty string, and, as a result, the error won't be raised. Of
course the URL or path will still be bogus.
- Make it possible to have ``testing.DummyTemplateRenderer`` return
some nondefault string representation.
- Added a new ``anchor`` keyword argument to ``model_url``. If
``anchor`` is present, its string representation will be used
as a named anchor in the generated URL (e.g. if ``anchor`` is
passed as ``foo`` and the model URL is
``http://example.com/model/url``, the generated URL will be
- The default request charset encoding is now ``utf-8``. As a result,
the request machinery will attempt to decode values from the utf-8
encoding to Unicode automatically when they are obtained via
``request.params``, ``request.GET``, and ``request.POST``. The
previous behavior of BFG was to return a bytestring when a value was
accessed in this manner. This change will break form handling code
in apps that rely on values from those APIs being considered
bytestrings. If you are manually decoding values from form
submissions in your application, you'll either need to change the
code that does that to expect Unicode values from
``request.params``, ``request.GET`` and ``request.POST``, or you'll
need to explicitly reenable the previous behavior. To reenable the
previous behavior, add the following to your application's
See also the documentation in the "Views" chapter of the BFG docs
entitled "Using Views to Handle Form Submissions (Unicode and
Character Set Issues)".
- Add a section to the narrative Views chapter entitled "Using Views
to Handle Form Submissions (Unicode and Character Set Issues)"
explaining implicit decoding of form data values.
Repoze-dev mailing list