This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eryksun, mba, serhiy.storchaka, steve.dower, vstinner, xdegaye, xiang.zhang
Date 2017-05-17.18:48:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Before 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c, the code used PyLong_FromLong((long)st->st_ino), so the change doesn't introduce a regression but detected a real bug, right?

> On Android architecture 'x86' at api level 21:
>    sizeof(st->st_ino) = 8
> and from the output of configure:
>    checking size of off_t... 4
>    checking size of long... 4
>    checking size of long long... 8

What is the type of st_ino? It's not off_t?

A workaround would be to force the usage unsigned long long on Android, right?

Can you please try the following patch on Android, and propose a PR if it works?

diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index e8c15a9..78b3cb9 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1927,7 +1927,7 @@ _pystat_fromstructstat(STRUCT_STAT *st)
         return NULL;
     PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
-#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS)
+#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS) || defined(defined(__ANDROID__))
     Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
     PyStructSequence_SET_ITEM(v, 1,
Date User Action Args
2017-05-17 18:48:50vstinnersetrecipients: + vstinner, xdegaye, serhiy.storchaka, eryksun, steve.dower, xiang.zhang, mba
2017-05-17 18:48:50vstinnersetmessageid: <>
2017-05-17 18:48:50vstinnerlinkissue29619 messages
2017-05-17 18:48:50vstinnercreate