diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-05-07 08:56:12 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-05-07 08:56:12 +0200 |
commit | c6fdeaf7e57dd671260e4a9222d2334e7a25184e (patch) | |
tree | 022c10b053251a3302d0aed35e5e799a885c794d | |
parent | 9f08029361e6ea8033600217911ae1ab81fde3af (diff) | |
download | weechat-c6fdeaf7e57dd671260e4a9222d2334e7a25184e.zip |
python: fix crash when loading scripts with Python 3.x (patch #8044) (thanks to isak)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/plugins/python/weechat-python.c | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.4.1-rc1, 2013-05-06 +v0.4.1-rc1, 2013-05-07 This document lists all changes for each version. @@ -90,6 +90,7 @@ Version 0.4.1 (under dev!) * lua: fix crash on stack overflow: call lua_pop() for values returned by lua functions (bug #38510) * perl: simplify code to load scripts +* python: fix crash when loading scripts with Python 3.x (patch #8044) * relay: rename compression "gzip" to "zlib" (compression is zlib, not gzip) * relay: add message "_nicklist_diff" (differences between old and current nicklist) diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index 7c8c09cb0..becd762ab 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -618,7 +618,7 @@ weechat_python_load (const char *filename) python_current_interpreter = Py_NewInterpreter (); #if PY_MAJOR_VERSION >= 3 /* python >= 3.x */ - len = strlen (argv[0]); + len = mbstowcs (NULL, argv[0], 0) + 1; wargv[0] = malloc ((len + 1) * sizeof (wargv[0][0])); if (wargv[0]) { |