--- plugins/python-loader/plugin.c.orig	2016-06-13 21:39:50.000000000 -0700
+++ plugins/python-loader/plugin.c	2016-06-13 22:11:53.000000000 -0700
@@ -93,6 +93,12 @@
 /* AnjutaPlugin functions
  *---------------------------------------------------------------------------*/
 
+#if PY_MAJOR_VERSION >= 3
+#include <stdlib.h>
+
+static wchar_t *wargv;
+#endif
+
 static gboolean
 pyl_plugin_activate (AnjutaPlugin *plugin)
 {
@@ -112,7 +118,15 @@
 		return FALSE;
 	}
 
+#if PY_MAJOR_VERSION >= 3
+	char *s = argv[0];
+	size_t slen = sizeof (s);
+	wargv = (wchar_t *) calloc (slen + 1, sizeof (wchar_t));
+	mbstowcs (wargv, s, slen);
+	PySys_SetArgv (1, &wargv);
+#else
 	PySys_SetArgv (1, argv);
+#endif
 
 	/* Retrieve the Python type for anjuta plugin */
 	m = PyImport_ImportModule ("gi.repository.Anjuta");
@@ -136,6 +150,10 @@
 		while (PyGC_Collect ())
 			;
 
+#if PY_MAJOR_VERSION >= 3
+		free (wargv);
+#endif
+
 		Py_Finalize ();
 	}
 
