Backport r61450 from trunk:
 Fix chown on 64-bit linux.  It needed to take a long (64-bit on 64bit linux) as
 uid and gid input to accept values >=2**31 as valid while still accepting
 negative numbers to pass -1 to chown for "no change".

 Fixes issue1747858.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7795827..568dcfd 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1779,9 +1779,9 @@
 posix_chown(PyObject *self, PyObject *args)
 {
 	char *path = NULL;
-	int uid, gid;
+	long uid, gid;
 	int res;
-	if (!PyArg_ParseTuple(args, "etii:chown",
+	if (!PyArg_ParseTuple(args, "etll:chown",
 	                      Py_FileSystemDefaultEncoding, &path,
 	                      &uid, &gid))
 		return NULL;