Bug#495272: [PATCH 0/2] deb822: Better support for non-ascii values

John Wright john.wright at hp.com
Fri Jan 29 01:41:01 UTC 2010


tags 495272 + patch
thanks

This is a proposed patchset for bug 495272.

I think the first in the series should be applied either way - it fixes
a wart in _multivalued, that its dump method reimplements a lot of
Deb822.dump.

I'm looking for comments on the second patch, since it changes a fairly
fundamental aspect of how Deb822 objects work.  Basically, it ensures
all "string" values in a Deb822 object are returned as unicode objects
instead.  When it takes a byte string (whether from a file or other
iterator) as input, it uses the new encoding keyword argument given to
its constructor to decode the string to a unicode object.

Deb822 objects can still contain non-string-type values, and in that
case, the __getitem__ method doesn't attempt any conversion.  (So you
still could have a list of strings with non-ascii characters, which
could be problematic.  But in general, we've only ensured that you can
dump a Deb822 object if its values are strings or supported multivalued
lists, so I think this is acceptable.)

Anybody see shortcomings I have missed?

John Wright (2):
  deb822: Refactor _multivalued.dump
  deb822: Better support for non-ascii values

 debian_bundle/deb822.py |  135 ++++++++++++++++++++++++++++-------------------
 tests/test_deb822.py    |    2 +-
 2 files changed, 81 insertions(+), 56 deletions(-)






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