| @@ -1927,11 +1927,13 @@ _pystat_fromstructstat(STRUCT_STAT *st) | ||
| return NULL; | ||
| PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode)); | ||
| -#ifdef HAVE_LARGEFILE_SUPPORT | ||
| +#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS) | ||
| + assert(sizeof(st->st_ino) >= sizeof(unsigned long long)); |
Use Py_BUILD_ASSERT.
Should test sizeof(st->st_ino) <= sizeof(unsigned long long).
| @@ -11409,7 +11411,8 @@ os_DirEntry_inode_impl(DirEntry *self) | ||
| self->win32_file_index = stat.st_ino; | ||
| self->got_file_index = 1; | ||
| } | ||
| - return PyLong_FromLongLong((long long)self->win32_file_index); | ||
| + assert(sizeof(self->win32_file_index) >= sizeof(unsigned long long)); |
| haypo + haypo |
642ff68
|
|
Ok, let's start with a backport to 3.6: #584 |
| haypo |
68d2980
|
bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode
(st_ino) using unsigned integers.