equal
deleted
inserted
replaced
756 |
756 |
757 #ifndef SETPROCNAME_USE_NONE |
757 #ifndef SETPROCNAME_USE_NONE |
758 static PyObject *setprocname(PyObject *self, PyObject *args) |
758 static PyObject *setprocname(PyObject *self, PyObject *args) |
759 { |
759 { |
760 const char *name = NULL; |
760 const char *name = NULL; |
761 if (!PyArg_ParseTuple(args, "s", &name)) |
761 if (!PyArg_ParseTuple(args, PY23("s", "y"), &name)) |
762 return NULL; |
762 return NULL; |
763 |
763 |
764 #if defined(SETPROCNAME_USE_SETPROCTITLE) |
764 #if defined(SETPROCNAME_USE_SETPROCTITLE) |
765 setproctitle("%s", name); |
765 setproctitle("%s", name); |
766 #elif defined(SETPROCNAME_USE_ARGVREWRITE) |
766 #elif defined(SETPROCNAME_USE_ARGVREWRITE) |
1103 static PyObject *getfstype(PyObject *self, PyObject *args) |
1103 static PyObject *getfstype(PyObject *self, PyObject *args) |
1104 { |
1104 { |
1105 const char *path = NULL; |
1105 const char *path = NULL; |
1106 struct statfs buf; |
1106 struct statfs buf; |
1107 int r; |
1107 int r; |
1108 if (!PyArg_ParseTuple(args, "s", &path)) |
1108 if (!PyArg_ParseTuple(args, PY23("s", "y"), &path)) |
1109 return NULL; |
1109 return NULL; |
1110 |
1110 |
1111 memset(&buf, 0, sizeof(buf)); |
1111 memset(&buf, 0, sizeof(buf)); |
1112 r = statfs(path, &buf); |
1112 r = statfs(path, &buf); |
1113 if (r != 0) |
1113 if (r != 0) |
1121 static PyObject *getfsmountpoint(PyObject *self, PyObject *args) |
1121 static PyObject *getfsmountpoint(PyObject *self, PyObject *args) |
1122 { |
1122 { |
1123 const char *path = NULL; |
1123 const char *path = NULL; |
1124 struct statfs buf; |
1124 struct statfs buf; |
1125 int r; |
1125 int r; |
1126 if (!PyArg_ParseTuple(args, "s", &path)) |
1126 if (!PyArg_ParseTuple(args, PY23("s", "y"), &path)) |
1127 return NULL; |
1127 return NULL; |
1128 |
1128 |
1129 memset(&buf, 0, sizeof(buf)); |
1129 memset(&buf, 0, sizeof(buf)); |
1130 r = statfs(path, &buf); |
1130 r = statfs(path, &buf); |
1131 if (r != 0) |
1131 if (r != 0) |
1162 char *path, *skip = NULL; |
1162 char *path, *skip = NULL; |
1163 int wantstat, plen; |
1163 int wantstat, plen; |
1164 |
1164 |
1165 static char *kwlist[] = {"path", "stat", "skip", NULL}; |
1165 static char *kwlist[] = {"path", "stat", "skip", NULL}; |
1166 |
1166 |
1167 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|OO:listdir", |
1167 if (!PyArg_ParseTupleAndKeywords(args, kwargs, PY23("s#|OO:listdir", |
|
1168 "y#|OO:listdir"), |
1168 kwlist, &path, &plen, &statobj, &skipobj)) |
1169 kwlist, &path, &plen, &statobj, &skipobj)) |
1169 return NULL; |
1170 return NULL; |
1170 |
1171 |
1171 wantstat = statobj && PyObject_IsTrue(statobj); |
1172 wantstat = statobj && PyObject_IsTrue(statobj); |
1172 |
1173 |
1195 char fpmode[4]; |
1196 char fpmode[4]; |
1196 int fppos = 0; |
1197 int fppos = 0; |
1197 int plus; |
1198 int plus; |
1198 FILE *fp; |
1199 FILE *fp; |
1199 |
1200 |
1200 if (!PyArg_ParseTupleAndKeywords(args, kwds, "et|si:posixfile", kwlist, |
1201 if (!PyArg_ParseTupleAndKeywords(args, kwds, PY23("et|si:posixfile", |
|
1202 "et|yi:posixfile"), |
|
1203 kwlist, |
1201 Py_FileSystemDefaultEncoding, |
1204 Py_FileSystemDefaultEncoding, |
1202 &name, &mode, &bufsize)) |
1205 &name, &mode, &bufsize)) |
1203 return NULL; |
1206 return NULL; |
1204 |
1207 |
1205 m0 = mode[0]; |
1208 m0 = mode[0]; |