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]) diff -r 6a2f74811240 pyconfig.h.in --- a/configure Thu Oct 23 23:03:35 2014 +0200 +++ b/configure Fri Oct 24 17:36:57 2014 -0500 @@ -15611,6 +15611,15 @@ $as_echo "$ENSUREPIP" >&6; } +ac_fn_c_check_member "$LINENO" "struct passwd" "pw_gecos" "ac_cv_member_struct_passwd_pw_gecos" "#include +" +if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes; then : + +$as_echo "#define HAVE_PASSWD_GECOS_FIELD 1" >>confdefs.h + +fi + + # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh" --- a/pyconfig.h.in Thu Oct 23 23:03:35 2014 +0200 +++ b/pyconfig.h.in Fri Oct 24 17:36:57 2014 -0500 @@ -612,6 +612,9 @@ /* Define if compiling using MacOS X 10.5 SDK or later. */ #undef HAVE_OSX105_SDK +/* Define if defines field passwd.pw_gecos */ +#undef HAVE_PASSWD_GECOS_FIELD + /* Define to 1 if you have the `pathconf' function. */ #undef HAVE_PATHCONF