From c6c8fab76ab014cf311cae6ce1529788cd0da1d0 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 13 Mar 2009 09:26:04 +0200 Subject: [PATCH] rpm-python only accepts string objects, not unicode - Reverts broken commit 832fe4f01865cd17ab9393fc48b960206da223b0. Anything trying to pass in unicode objects is already broken as PyString_AsString() uses default encoding for unicode conversions, which by default is ascii (at least in python >= 2.5) so any non-ascii string will cause it to fail anyway. - Only accepting strings keeps encoding madness out of rpm, thank you Toshio. --- python/rpmts-py.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 84da9cb..e56e001 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -1100,7 +1100,7 @@ fprintf(stderr, "*** rpmts_Match(%p) ts %p\n", s, s->ts); } if (Key) { - if (PyString_Check(Key) || PyUnicode_Check(Key)) { + if (PyString_Check(Key)) { key = PyString_AsString(Key); len = PyString_Size(Key); } else if (PyInt_Check(Key)) { -- 2.7.4