~jelmer/pygpgme/bug452194

« back to all changes in this revision

Viewing changes to src/pygpgme-signature.c

  • Committer: James Henstridge
  • Date: 2009-04-01 09:05:02 UTC
  • Revision ID: james@jamesh.id.au-20090401090502-n5fzpujqoi15q2bd
Convert code that was generating byte strings to unicode strings where
appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        item->hash_algo = PyInt_FromLong(sig->hash_algo);
73
73
        item->timestamp = PyInt_FromLong(sig->timestamp);
74
74
        if (sig->fpr) {
75
 
            item->fpr = PyBytes_FromString(sig->fpr);
 
75
            item->fpr = PyUnicode_DecodeASCII(sig->fpr, strlen(sig->fpr),
 
76
                                              "replace");
76
77
        } else {
77
78
            Py_INCREF(Py_None);
78
79
            item->fpr = Py_None;
148
149
        }
149
150
        item->summary = PyInt_FromLong(sig->summary);
150
151
        if (sig->fpr) {
151
 
            item->fpr = PyBytes_FromString(sig->fpr);
 
152
            item->fpr = PyUnicode_DecodeASCII(sig->fpr, strlen(sig->fpr),
 
153
                                              "replace");
152
154
        } else {
153
155
            Py_INCREF(Py_None);
154
156
            item->fpr = Py_None;