[Python-checkins] cpython: Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on
When merging some changes while working on scandir, I noticed a minor issue with this commit: https://hg.python.org/cpython/rev/4f6f4aa0d80f The definition of "struct win32_stat" has been moved to fileutils.h and renamed to "struct _Py_stat_struct", which is fine -- however, the old "struct win32_stat" definition is still present (but unused) in posixmodule.c. So I think the old "struct win32_stat { ... }" definition can simply be removed from posixmodule.c now. Also, unrelated to this commit, I notice the _Py_attribute_data_to_stat function (was attribute_data_to_stat) can't fail and always returns 0, and all callers ignore its return value anyway. Can it be changed to return void? -Ben
On Sat Feb 21 2015 at 4:23:16 PM Ben Hoyt <benhoyt@gmail.com> wrote:
When merging some changes while working on scandir, I noticed a minor issue with this commit:
https://hg.python.org/cpython/rev/4f6f4aa0d80f
The definition of "struct win32_stat" has been moved to fileutils.h and renamed to "struct _Py_stat_struct", which is fine -- however, the old "struct win32_stat" definition is still present (but unused) in posixmodule.c.
So I think the old "struct win32_stat { ... }" definition can simply be removed from posixmodule.c now.
I don't think win32_stat is part of the stable ABI so as long as everything keeps working then I don't see why it needs to stick around.
Also, unrelated to this commit, I notice the _Py_attribute_data_to_stat function (was attribute_data_to_stat) can't fail and always returns 0, and all callers ignore its return value anyway. Can it be changed to return void?
Don't see why not since it's a private API.
Agreed. I've made both of these changes. Thanks for the suggestions Cheers, Steve Top-posted from my Windows Phone ________________________________ From: Brett Cannon<mailto:brett@python.org> Sent: 2/21/2015 14:13 To: Ben Hoyt<mailto:benhoyt@gmail.com>; Python-Dev<mailto:python-dev@python.org> Subject: Re: [Python-Dev] [Python-checkins] cpython: Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on On Sat Feb 21 2015 at 4:23:16 PM Ben Hoyt <benhoyt@gmail.com<mailto:benhoyt@gmail.com>> wrote: When merging some changes while working on scandir, I noticed a minor issue with this commit: https://hg.python.org/cpython/rev/4f6f4aa0d80f The definition of "struct win32_stat" has been moved to fileutils.h and renamed to "struct _Py_stat_struct", which is fine -- however, the old "struct win32_stat" definition is still present (but unused) in posixmodule.c. So I think the old "struct win32_stat { ... }" definition can simply be removed from posixmodule.c now. I don't think win32_stat is part of the stable ABI so as long as everything keeps working then I don't see why it needs to stick around. Also, unrelated to this commit, I notice the _Py_attribute_data_to_stat function (was attribute_data_to_stat) can't fail and always returns 0, and all callers ignore its return value anyway. Can it be changed to return void? Don't see why not since it's a private API.
participants (3)
-
Ben Hoyt
-
Brett Cannon
-
Steve Dower