mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Disable legacy encoding mode when modpython is loaded.
Python is not happy when using non-unicode text as str. Fix #1229
This commit is contained in:
@@ -82,6 +82,7 @@ class CModPython : public CModule {
|
||||
}
|
||||
|
||||
MODCONSTRUCTOR(CModPython) {
|
||||
CZNC::Get().ForceEncoding();
|
||||
Py_Initialize();
|
||||
m_PyFormatException = nullptr;
|
||||
m_PyZNCModule = nullptr;
|
||||
@@ -386,6 +387,7 @@ class CModPython : public CModule {
|
||||
Py_CLEAR(m_PyFormatException);
|
||||
Py_CLEAR(m_PyZNCModule);
|
||||
Py_Finalize();
|
||||
CZNC::Get().UnforceEncoding();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user