[python-meh] Nasty-hack-class resolving some problems

Vratislav Podzimek vpodzime at redhat.com
Fri Dec 14 11:09:44 UTC 2012


The following patch adds a safe_string module and SafeStr class that should (and
from the test seems to) resolve problems with unicode strings in all forms,
binary data and whatever can come up to python-meh's processing.

I know it is a hack, but I'm really tired from adding 'if type(obj) ==
types.UnicodeType:" and adding a check for binary data to all these places would
drive me crazy.

Vratislav Podzimek (1):
  Add safe_string module and tests

 meh/dump.py               | 13 ++++------
 meh/safe_string.py        | 60 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/handle_binary.py    | 24 +++++++++++++++++++
 tests/safe_string_test.py | 38 ++++++++++++++++++++++++++++++
 4 files changed, 126 insertions(+), 9 deletions(-)
 create mode 100644 meh/safe_string.py
 create mode 100644 tests/handle_binary.py
 create mode 100755 tests/safe_string_test.py

-- 
1.7.11.7



More information about the anaconda-patches mailing list