New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_grp and test_pwd fail with 32-bit builds on OS X systems #61733
Comments
With the changes introduced for bpo-4591, test_grp and test_pwd now fail on OS X systems when Python is run in 32-bit mode. Previously, using a 64-bit/32-bit universal build of 2.7.3: $ arch -i386 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nobody").gr_gid; print(g,type(g))'
(-2, <type 'int'>)
$ arch -x86_64 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nobody").gr_gid; print(g,type(g))'
(4294967294, <type 'int'>) Now, with 2.7.4rc1: $ arch -i386 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nobody").gr_gid; print(g,type(g))'
(4294967294L, <type 'long'>)
$ arch -x86_64 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nobody").gr_gid; print(g,type(g))'
(4294967294, <type 'int'>) This results in test failures in both test_grp and test_pwd: ====================================================================== Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_grp.py", line 27, in test_values
self.check_value(e)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_grp.py", line 19, in check_value
self.assertIsInstance(value.gr_gid, int)
AssertionError: 4294967294L is not an instance of <type 'int'>
----------------------------------------------------------------------
====================================================================== Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_pwd.py", line 23, in test_values
self.assertIsInstance(e.pw_gid, int)
AssertionError: 4294967294L is not an instance of <type 'int'> |
Failure also seen on 32-bit buildbot: |
New changeset 2aa817e0a645 by Benjamin Peterson in branch '2.7': |
I hope that does it? |
No, that was wrong, sorry. |
I think the tests are wrong. |
New changeset c982393bea4e by Benjamin Peterson in branch '2.7': |
That fixes the test for nobody (-2). Now the next part of the test fails more seriously for nogroup (-1). Simplifying: 2.7.3 2.7.4rc1:
$ arch -i386 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nogroup").gr_gid; print(grp.getgrgid(g),type(g))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
OverflowError: group id is greater than maximum
$ arch -x86_64 /usr/local/bin/python2.7 -c 'import grp; g=grp.getgrnam("nogroup").gr_gid; print(grp.getgrgid(g),type(g))'
(grp.struct_group(gr_name='nogroup', gr_passwd='*', gr_gid=4294967295, gr_mem=[]), <type 'int'>) |
Whack, whack. a4dbe53577cb |
a4dbe53577cb appears to fix the latter problem. Thanks! |
New changeset 87d266988905 by Benjamin Peterson in branch '2.7': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: