Package: python-nautilus
Followup-For: Bug #512310

Hey,

this is fixed upstream since r48, but they modify a bit more source.
I attach a patch I extracted from SVN and think that should be applied to the 
package.
However, I don't have a amd64 box with X here to test whether the patch helps.
Could you try if I provide you a .deb?

Regards
Evgeni
2008-01-11  Jonathan Rogers <jon...@teegra.net>
	reviewed by: Johan Dahlin

	* src/nautilus-python-object.c:
	* src/nautilus-python.c: (nautilus_python_load_file):
	* src/nautilus-python.h:
	Use Py_ssize_t instead of int, so nautilus-python works on Python 2.5
	fixes #444366	

Index: nautilus-python/src/nautilus-python.c
===================================================================
--- nautilus-python/src/nautilus-python.c	(revision 47)
+++ nautilus-python/src/nautilus-python.c	(revision 48)
@@ -114,7 +114,7 @@
 	PyObject *main_module, *main_locals, *locals, *key, *value;
 	PyObject *module;
 	GType gtype;
-	int pos = 0;
+	Py_ssize_t pos = 0;
 	
 	debug_enter_args("filename=%s", filename);
 	
Index: nautilus-python/src/nautilus-python-object.c
===================================================================
--- nautilus-python/src/nautilus-python-object.c	(revision 47)
+++ nautilus-python/src/nautilus-python-object.c	(revision 48)
@@ -74,7 +74,7 @@
 
 #define HANDLE_LIST(py_ret, type, type_name)                           \
     {                                                                  \
-        int i = 0;                                                     \
+        Py_ssize_t i = 0;                                                     \
     	if (!PySequence_Check(py_ret) || PyString_Check(py_ret)) {     \
     		PyErr_SetString(PyExc_TypeError,                           \
     						METHOD_NAME " must return a sequence");    \
Index: nautilus-python/src/nautilus-python.h
===================================================================
--- nautilus-python/src/nautilus-python.h	(revision 47)
+++ nautilus-python/src/nautilus-python.h	(revision 48)
@@ -26,6 +26,12 @@
 #include <glib/gprintf.h>
 #include <Python.h>
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 typedef enum {
     NAUTILUS_PYTHON_DEBUG_MISC = 1 << 0,
 } NautilusPythonDebug;

Reply via email to