New submission from Jesús Cea Avión: Dan MacDonald told me that "os.mknod()" should accept devices >32 bits.
I wrote this code in linux 64 bits: """ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> int main(void) { printf("%d", sizeof(dev_t)); return 0; } """ The result of running this is "8". We need a long long. I did this change in Python 2.7 branch: """ diff -r f00412d32b41 Modules/posixmodule.c --- a/Modules/posixmodule.c Sat Dec 20 13:41:14 2014 -0600 +++ b/Modules/posixmodule.c Sun Dec 21 23:30:00 2014 +0100 @@ -7009,9 +7009,9 @@ { char *filename; int mode = 0600; - int device = 0; + long long device = 0; int res; - if (!PyArg_ParseTuple(args, "s|ii:mknod", &filename, &mode, &device)) + if (!PyArg_ParseTuple(args, "s|iL:mknod", &filename, &mode, &device)) return NULL; Py_BEGIN_ALLOW_THREADS res = mknod(filename, mode, device); """ Looks like this patch is trivial. Please, comment. ---------- assignee: jcea keywords: easy messages: 233004 nosy: jcea priority: normal severity: normal stage: patch review status: open title: mknod devices can be >32 bits versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23098> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com