Menu

#156 Change MAPI GetLastError()

Unstable (example)
closed-fixed
nobody
None
5
2016-02-27
2016-01-22
No

This patch should remove the need for the typemap fix in [#154] entirely. The patch however unfortunately repeats the same ~20 line change in each of the interface class implementations. With this change, passing the MAPI_UNICODE flag has an effect on both the requested and returned values.

An additional function PyWinObject_FromMAPIStr() is introduced to ensure the returned strings are coerced to the expected type:

  • For Python 3, this always means unicode. i.e., if MAPI_UNICODE was not passed, PyUnicode_DecodeMBCS() is called.
  • For Python 2, if MAPI_UNICODE was not passed, PyString_FromString() is called.

Additionally, PyObject_FromMAPIERROR() has been changed to simply call PyWinObject_FromMAPIStr()

1 Attachments

Related

Old Patches - new patches via https://github.com/mhammond/pywin32/pulls: #154
Old Patches - new patches via https://github.com/mhammond/pywin32/pulls: #157

Discussion

  • Mark Hammond

    Mark Hammond - 2016-02-27
    • status: open --> closed-fixed
     
  • Mark Hammond

    Mark Hammond - 2016-02-27

    4389:e32aa302e540

     

Log in to post a comment.