[pywin32-checkins] /hgroot/pywin32/pywin32: Support PT_MV_BINARY MAPI properties, v...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2015-01-05 05:19:22
|
changeset b81227a0b147 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=b81227a0b147 summary: Support PT_MV_BINARY MAPI properties, via patch #37 diffstat: CHANGES.txt | 1 + com/win32comext/mapi/src/mapiutil.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diffs (30 lines): diff -r fcfbe0ff52ca -r b81227a0b147 CHANGES.txt --- a/CHANGES.txt Sat Dec 06 14:56:04 2014 -0500 +++ b/CHANGES.txt Mon Jan 05 16:19:06 2015 +1100 @@ -10,6 +10,7 @@ Addded outlook interface IConverterSession with methods MIMEToMAPI, MAPIToMIMEStm, and SetAdrBook Added method OpenStreamOnFile (Nick Czeczulin) Ignore PT_MV_TSTRING along with PT_TSTRING (Nick Czeczulin) + Bugfix to support PT_MV_BINARY properties (Nick Czeczulin via patch #37) * Conversions from a Python object to a variant now does a better job at deciding what variant type to use, taking into account the size and sign of diff -r fcfbe0ff52ca -r b81227a0b147 com/win32comext/mapi/src/mapiutil.cpp --- a/com/win32comext/mapi/src/mapiutil.cpp Sat Dec 06 14:56:04 2014 -0500 +++ b/com/win32comext/mapi/src/mapiutil.cpp Mon Jan 05 16:19:06 2015 +1100 @@ -305,8 +305,13 @@ for (i=0;!PyErr_Occurred() && i<pv->Value.MVbin.cValues;i++) { PyObject *obmv=PySequence_GetItem(ob,i); if (obmv==NULL) break; - pv->Value.MVbin.lpbin[i].lpb = (unsigned char *)PyString_AsString(ob); - pv->Value.MVbin.lpbin[i].cb = PyString_Size(ob); + if (!PyString_Check(obmv)) { + Py_DECREF(obmv); + PyErr_SetString(PyExc_TypeError, "PT_MV_BINARY elements must be strings"); + break; + } + pv->Value.MVbin.lpbin[i].lpb = (unsigned char *)PyString_AsString(obmv); + pv->Value.MVbin.lpbin[i].cb = PyString_Size(obmv); Py_DECREF(obmv); } break; |