Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ However contributors are encouraged to add their own entries for their work.

Note that build 228 was the last version supporting Python 2.

Since build 303:
----------------
* Fixed codepage/mojibake issues when non-ascii characters were included in
COM exceptions raised by Python apps. This should be invisible, but might
break any workarounds which were used, such as using specific encodings in
these strings. (#1823, #1833)

Since build 302:
----------------
* Tweaks to how DLLs are loaded and our installation found, which should
Expand Down
10 changes: 5 additions & 5 deletions Pythonwin/win32uimodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,13 @@ BOOL DisplayPythonTraceback(PyObject *exc_type, PyObject *exc_val, PyObject *exc
SetWindowText(title);
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
GetDlgItem(IDOK)->SetWindowText(_T("Close"));
char *msg = GetPythonTraceback(m_exc_type, m_exc_value, m_exc_tb);
char *msg_free = msg;
WCHAR *msg = GetPythonTraceback(m_exc_type, m_exc_value, m_exc_tb);
WCHAR *msg_free = msg;
// Translate '\n' to '\r\n' - do it the easy way!
CString useMsg;
for (; *msg; msg++)
if (*msg == '\n')
useMsg += "\r\n";
if (*msg == L'\n')
useMsg += L"\r\n";
else
useMsg += *msg;
free(msg_free);
Expand Down Expand Up @@ -659,7 +659,7 @@ void DefaultExceptionHandler(int action, const TCHAR *context, const TCHAR *extr
}
else
PyErr_Restore(type, value, traceback);
fprintf(stderr, "%s\n", context);
fwprintf(stderr, L"%s\n", context);
// Now print it.
PyErr_Print();
}
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/makegw/makegwenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _write_enumgw_cpp(f, interface):
error:
PyErr_Clear(); // just in case
Py_DECREF(result);
return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnum%(enumtype)s, "Next() did not return a sequence of objects");
return PyCom_HandleIEnumNoSequence(IID_IEnum%(enumtype)s);
}

STDMETHODIMP PyGEnum%(enumtype)s::Skip(
Expand Down Expand Up @@ -324,7 +324,7 @@ def _write_enumgw_cpp(f, interface):
/* done with the result; this DECREF is also for <punk> */
Py_DECREF(result);

return PyCom_SetCOMErrorFromSimple(hr, IID_IEnum%(enumtype)s, "Python could not convert the result from Next() into the required COM interface");
return PyCom_CheckIEnumNextResult(hr, IID_IEnum%(enumtype)s);
}
"""
% locals()
Expand Down
Loading