diff -r f2a2d6e68de2 Cython/Compiler/ExprNodes.py
--- a/Cython/Compiler/ExprNodes.py	Wed Mar 11 11:36:55 2009 -0200
+++ b/Cython/Compiler/ExprNodes.py	Wed Mar 11 12:15:30 2009 -0200
@@ -2135,7 +2135,7 @@
             check = stop
         if check:
             code.putln("if (unlikely((%s) != %d)) {" % (check, target_size))
-            code.putln('PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%d, got %%d", %d, (%s));' % (
+            code.putln('PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%"PY_FORMAT_SIZE_T"d, got %%"PY_FORMAT_SIZE_T"d", (Py_ssize_t)%d, (Py_ssize_t)(%s));' % (
                         target_size, check))
             code.putln(code.error_goto(self.pos))
             code.putln("}")
diff -r f2a2d6e68de2 Cython/Compiler/ModuleNode.py
--- a/Cython/Compiler/ModuleNode.py	Wed Mar 11 11:36:55 2009 -0200
+++ b/Cython/Compiler/ModuleNode.py	Wed Mar 11 12:15:30 2009 -0200
@@ -421,6 +421,7 @@
         code.putln("  typedef int Py_ssize_t;")
         code.putln("  #define PY_SSIZE_T_MAX INT_MAX")
         code.putln("  #define PY_SSIZE_T_MIN INT_MIN")
+        code.putln("  #define PY_FORMAT_SIZE_T \"\"")
         code.putln("  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)")
         code.putln("  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)")
         code.putln("  #define PyNumber_Index(o)    PyNumber_Int(o)")
