Message293873
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,
PyLong_FromUnsignedLongLong(st->st_ino)); |
|
Date |
User |
Action |
Args |
2017-05-17 18:48:50 | vstinner | set | recipients:
+ vstinner, xdegaye, serhiy.storchaka, eryksun, steve.dower, xiang.zhang, mba |
2017-05-17 18:48:50 | vstinner | set | messageid: <1495046930.69.0.173220220963.issue29619@psf.upfronthosting.co.za> |
2017-05-17 18:48:50 | vstinner | link | issue29619 messages |
2017-05-17 18:48:50 | vstinner | create | |
|