-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-29619: Convert st_ino using unsigned integer #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Modules/posixmodule.c
Outdated
@@ -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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Py_BUILD_ASSERT
.
Should test sizeof(st->st_ino) <= sizeof(unsigned long long)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, I wrote my assertion backwards... Fixed, thanks!
Modules/posixmodule.c
Outdated
@@ -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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sizeof(self->win32_file_index) <= sizeof(unsigned long long)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode (st_ino) using unsigned integers.
Ok, let's start with a backport to 3.6: #584 |
Bumps [celery](https://github.com/celery/celery) from 5.2.6 to 5.2.7. - [Release notes](https://github.com/celery/celery/releases) - [Changelog](https://github.com/celery/celery/blob/master/Changelog.rst) - [Commits](celery/celery@v5.2.6...v5.2.7) --- updated-dependencies: - dependency-name: celery dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode
(st_ino) using unsigned integers.