Changes in 0.1.15 and how to use same code on stable machines

Andreas Tille andreas at an3as.eu
Sat Apr 10 11:33:22 UTC 2010


Hi,

for the Debian Pure Blends tasks pages I'm using python-debian.  I frequently
used code like

    printsting = unicode(stanza[field], 'utf-8')

to handle UTF-8 encoded strings.  When using python-debian >= 0.1.15
this results in

   TypeError: decoding Unicode is not supported

exceptions which is caused by the change which is refered to in the
changelog saying:

  [ John Wright ]
  * deb822: Better support for non-ascii values.  Deb822 objects now
    always contain unicode objects instead of strings.  Use the encoding
    argument to Deb822's initializer and its iter_paragraphs class
    method if the encoding of a file you are reading in is not utf-8.
    (The dump method also takes an encoding argument, if you wish the
    output not to be utf-8-encoded.) (Closes: #495272)

While I'm really happy about the change which simplifies things I wonder
what you would suggest to run the same code on development as well as
production machines (for instance alioth.debian.org which generates the
tasks pages).  Backports.debian.org is only featuring 0.1.14 and I have
no idea which code relays on the old behaviour and what might be broken
there would be a backport of the recent python-debian would be installed
on alioth.

Any hints?

Kind regards

     Andreas.


-- 
http://fam-tille.de



More information about the pkg-python-debian-maint mailing list