diff -r 6a2f74811240 Modules/pwdmodule.c --- a/Modules/pwdmodule.c Thu Oct 23 23:03:35 2014 +0200 +++ b/Modules/pwdmodule.c Fri Oct 24 17:36:57 2014 -0500 @@ -79,7 +79,12 @@ SETS(setIndex++, p->pw_passwd); PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid)); PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid)); +#if defined(HAVE_PASSWD_GECOS_FIELD) SETS(setIndex++, p->pw_gecos); +#else + SETS(setIndex++, Py_None); + Py_INCREF(Py_None); +#endif SETS(setIndex++, p->pw_dir); SETS(setIndex++, p->pw_shell); diff -r 6a2f74811240 configure diff -r 6a2f74811240 configure.ac --- a/configure.ac Thu Oct 23 23:03:35 2014 +0200 +++ b/configure.ac Fri Oct 24 17:36:57 2014 -0500 @@ -4892,6 +4892,11 @@ AC_MSG_RESULT($ENSUREPIP) AC_SUBST(ENSUREPIP) +AC_CHECK_MEMBER([struct passwd.pw_gecos], + [AC_DEFINE(HAVE_PASSWD_GECOS_FIELD, 1, [Define if defines field passwd.pw_gecos])], + [], + [[#include ]]) + # generate output files AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh) AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])