Serhiy Storchaka added the comment:
Committed to 2.7 with small change: stat() and makedev() should return int
instead of long if possible.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker
Roundup Robot added the comment:
New changeset 7ee09e2fec13 by Serhiy Storchaka in branch '2.7':
Issue #23098: 64-bit dev_t is now supported in the os module.
https://hg.python.org/cpython/rev/7ee09e2fec13
New changeset 18703ffea2b3 by Serhiy Storchaka in branch '3.4':
Issue #23098: 64-bit
Serhiy Storchaka added the comment:
This is not so easy as look at first glance. PY_LONG_LONG should be used
instead of long long. And as far as this type is optional, its use should be
conditional if HAVE_LONG_LONG is defined.
May be needed complex converter like _Py_Uid_Converter because
Jesús Cea Avión added the comment:
Serhiy, could you consider to create a patch for 2.7 and 3.4?. I am not
familiar with the details of Argument Clinic.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23098
Serhiy Storchaka added the comment:
Here is a patch against 3.5. Unsigned bitwise int converter is used for dev_t
because dev_t can be unsigned (and it is on Linux). This is not ideal solution,
there is no overflow check, but at least it should work for correct code.
--
keywords:
Serhiy Storchaka added the comment:
As pointed by Antoine there are other affected functions. Updated patch fixes
converting of arguments or results in makedev(), major() and minor().
--
Added file: http://bugs.python.org/file37527/posix_dev_t_converter-3.5_2.patch
Serhiy Storchaka added the comment:
And here are patches for 2.7 and 3.4 (unfortunately none of patches is applied
clear to other version).
--
Added file: http://bugs.python.org/file37532/posix_dev_t_converter-2.7.patch
Added file:
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));