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 2011年06月25日 15:54 by fgarciar, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (6) | |||
|---|---|---|---|
| msg139090 - (view) | Author: Francisco Garcia (fgarciar) | Date: 2011年06月25日 15:54 | |
pwd.struct_passwd has different representations in cpython 2.7.2 and pypy 1.5
A unit test from cpython might enforce the same representation across interpreters:
>>> print pwd.getpwuid(os.getuid())
Current cpython output:
pwd.struct_passwd(pw_name='demo_user', pw_passwd='********', pw_uid=1001, pw_gid=100, pw_gecos='demo_user', pw_dir='/Users/demo_user', pw_shell='/bin/bash')
Current pypy output
('demo_user', '********', 1001, 100, 'demo_user', '/Users/demo_user', '/bin/bash')
|
|||
| msg139094 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年06月25日 16:15 | |
Looks like the difference between a regular tuple and a named tuple. The correct test is to access the members using the names, and the test suite currently does this. The repr shouldn't, I think, be required to be identical. On the other hand, if pypy is implementing named tuples and the repr doesn't include the names, perhaps there is a missing test in the tests of named tuples. |
|||
| msg139650 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月02日 13:56 | |
The docs indeed don’t say more that "Password database entries are reported as a tuple-like object, whose attributes correspond to the members of the passwd structure"; no mention is made of named tuple or struct sequence. I think there is no bug for CPython; you may want to suggest friendlier reprs for structseqs to PyPy. |
|||
| msg139692 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2011年07月03日 17:18 | |
pypy did not use a structseq in this case. Fixed in (pypy's repo) dded6e510044 |
|||
| msg139694 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年07月03日 17:47 | |
But pypy passed the attribute access tests in the test suite? |
|||
| msg140274 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月13日 15:34 | |
Actually, I’ve found that there are some structseq’s repr that get tested in the CPython test suite. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:19 | admin | set | github: 56621 |
| 2011年07月13日 15:34:39 | eric.araujo | set | messages: + msg140274 |
| 2011年07月03日 17:47:41 | r.david.murray | set | messages: + msg139694 |
| 2011年07月03日 17:18:06 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg139692 |
| 2011年07月02日 13:56:24 | eric.araujo | set | status: open -> closed nosy: + eric.araujo, benjamin.peterson messages: + msg139650 resolution: works for me stage: resolved |
| 2011年06月25日 16:15:57 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg139094 |
| 2011年06月25日 15:54:49 | fgarciar | create | |