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
tests for sys.getsizeof fail on win64 #47397
Comments
the buildbot "AMD64 W2k8 trunk" systematically fails with the messages: ====================================================================== Traceback (most recent call last):
File
"S:\buildbots\python.x64\trunk.nelson-win64\build\lib\test\test_sys.py",
line 534, in test_specialtypes
self.check_sizeof({}, h + 3*l + 3*p + 8*(l + 2*p))
File
"S:\buildbots\python.x64\trunk.nelson-win64\build\lib\test\test_sys.py",
line 431, in check_sizeof
self.assertEqual(result, size, msg + str(size))
AssertionError: wrong size for <type 'dict'>: got 272, expected 224 ====================================================================== Traceback (most recent call last):
File
"S:\buildbots\python.x64\trunk.nelson-win64\build\lib\test\test_sys.py",
line 455, in test_standardtypes
self.check_sizeof(True, h + l)
File
"S:\buildbots\python.x64\trunk.nelson-win64\build\lib\test\test_sys.py",
line 431, in check_sizeof
self.assertEqual(result, size, msg + str(size))
AssertionError: wrong size for <type 'bool'>: got 40, expected 32 It seems that this platform is special: sizeof(long)==4 and |
The tests still do not pass on the AMD64 W2k8. Surprisingly, The tests pass until it comes to a situation where the size of long 8+8+16+4+2(+2) = 40 At least this how I think it should be and struct.calcsize does, 8+8+16+8+2(+6) = 48. It appears as if sizeof(long) = 8. The same explanation holds true for Now I don't know how I should address this problem. It seems to be It may also be a problem with struct.calcsize on Win64. Any suggestions? |
I can't quite follow your layout of a longint; in debug mode, I think it is
Notice that a ssize_t is 64 bits on Win64, so there shouldn't be any |
I think there are some other inconsistencies. For example, the tests for I agree it's very difficult to get it right... |
Fixed in r64533. |
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: