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.
Created on 2014年01月19日 18:23 by shiz, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| Python-3.4.0tip-workaround-android-missing-pw_gecos-field.patch | shiz, 2014年01月19日 18:23 | A patch that works around the lack of a pw_gecos field by setting the relevant value to None. | review | |
| pw_gecos-field-workaround-with-config_ac-mods.patch | WanderingLogic, 2014年10月24日 22:44 | shiz's patch extended with the required addition to configure.ac | review | |
| pw_gecos-field-workaround-with-config_ac-mods.patch | WanderingLogic, 2015年01月30日 22:42 | patch without mods to generated files (just mods pwdmodule.c and configure.ac) | review | |
| Messages (9) | |||
|---|---|---|---|
| msg208487 - (view) | Author: Shiz (shiz) * | Date: 2014年01月19日 18:23 | |
As the title states, mkpwent() in pwdmodule.c accesses `pw_gecos`, which is not defined for struct passwd in Bionic, Android's C library. Attached is a patch that works around the issue by setting the field to None on Android. |
|||
| msg217356 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2014年04月28日 10:21 | |
Interesting. It seems pw_gecos isn't mandated by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pwd.h.html I wonder if there's a better way to do this (autoconf check?) than an Android-specific #ifdef, though. |
|||
| msg217368 - (view) | Author: Shiz (shiz) * | Date: 2014年04月28日 12:20 | |
Ah, yes, if it's not actually mandated by POSIX, something like HAVE_PASSWD_PW_GECOS would be more appropriate. I'll rework the patch into something more generic. |
|||
| msg229964 - (view) | Author: Matt Frank (WanderingLogic) * | Date: 2014年10月24日 22:44 | |
Here is shiz's patch extended with the addition to configure.ac. I added the variable HAVE_PASSWD_GECOS_FIELD and the appropriate tests. Luckily this very problem (missing pw_gecos field) is the example used in the autoconf manual (https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Generic-Structures.html#Generic-Structures). (Otherwise I would have been as lost as I usually am with autoconf.) |
|||
| msg235061 - (view) | Author: Matt Frank (WanderingLogic) * | Date: 2015年01月30日 22:42 | |
Apologies. That last patch includes diffs to generated files (configure and pyconfig.h.in). This version just patches Modules/pwdmodule.c and configure.ac. After applying the patch please run "autoheader" and "autoconf" to correctly regenerate configure and pyconfig.h.in. |
|||
| msg264201 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年04月25日 23:10 | |
New changeset 0d74d4937ab9 by Stefan Krah in branch 'default': Issue #20306: The pw_gecos and pw_passwd fields are not required by POSIX. https://hg.python.org/cpython/rev/0d74d4937ab9 |
|||
| msg264229 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年04月26日 07:55 | |
With changeset 0d74d4937ab9, test_pwd fails on android API level 21 at test_values with: Traceback (most recent call last): File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_pwd.py", line 27, in test_values self.assertIsInstance(e.pw_passwd, str) AssertionError: None is not an instance of <class 'str'> On android API 21 HAVE_STRUCT_PASSWD_PW_PASSWD is defined but p->pw_passwd is set to NULL. |
|||
| msg264243 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年04月26日 09:43 | |
New changeset f0f519aca558 by Stefan Krah in branch 'default': Issue #20306: Android is the only system that returns NULL for the pw_passwd https://hg.python.org/cpython/rev/f0f519aca558 |
|||
| msg264244 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2016年04月26日 09:50 | |
Okay, for the record: I think that returning "None" would probably be more correct than the empty string, but I don't think users actually care to the point that they will introduce a case split in their applications. Realistically, probably no one cares about pw_passwd at all. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:57 | admin | set | github: 64505 |
| 2016年04月26日 09:50:06 | skrah | set | messages: + msg264244 |
| 2016年04月26日 09:43:35 | python-dev | set | messages: + msg264243 |
| 2016年04月26日 07:55:47 | xdegaye | set | nosy:
+ xdegaye messages: + msg264229 |
| 2016年04月26日 00:04:14 | skrah | set | status: open -> closed assignee: skrah components: + Build, - Cross-Build versions: + Python 3.6, - Python 3.4, Python 3.5 nosy: + skrah resolution: fixed stage: resolved |
| 2016年04月25日 23:10:39 | python-dev | set | nosy:
+ python-dev messages: + msg264201 |
| 2015年01月30日 22:42:38 | WanderingLogic | set | files:
+ pw_gecos-field-workaround-with-config_ac-mods.patch messages: + msg235061 |
| 2014年10月27日 15:58:33 | WanderingLogic | set | nosy:
+ freakboy3742 |
| 2014年10月24日 22:44:46 | WanderingLogic | set | files:
+ pw_gecos-field-workaround-with-config_ac-mods.patch messages: + msg229964 |
| 2014年10月24日 22:06:19 | WanderingLogic | set | nosy:
+ WanderingLogic |
| 2014年04月28日 12:20:48 | shiz | set | messages: + msg217368 |
| 2014年04月28日 10:21:21 | pitrou | set | nosy:
+ pitrou messages: + msg217356 versions: + Python 3.5 |
| 2014年01月19日 18:23:41 | shiz | create | |