~launchpad-pqm/python-debian/devel

« back to all changes in this revision

Viewing changes to tests/test_deb822.py

  • Committer: John Wright
  • Date: 2010-03-05 02:12:48 UTC
  • Revision ID: git-v1:25d6ec20c741ea9d5e63ff90e641dac0ee407cc2
deb822: Better support for non-ascii values

This patch changes Deb822Dict to give back only unicode values.  That
class (and the Deb822 subclass) now takes an encoding argument, which
defaults to "utf-8", and specifies how incoming strings are to be
interpreted.  Likewise, the dump method takes an optional encoding
argument to specify how to encode the unicode objects back to byte
strings before writing out to a file (and it defaults to the encoding
the object was initialized with).

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
    ]
147
147
 
148
148
 
149
 
CHANGES_FILE = '''\
 
149
CHANGES_FILE = u'''\
150
150
Format: 1.7
151
151
Date: Fri, 28 Dec 2007 17:08:48 +0100
152
152
Source: bzr-gtk