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
$DEBUG_PYTHON -O freeze.py broken #36948
Comments
I have no idea how long this bug has existed for. I To reproduce, build a debug python, cd to Tools/freeze/ $ /path/to/python -O freeze.py hello.py I get a wodge ot modulefinder (I presume) output, and then: freezing BaseHTTPServer ... This is on x86; on my PPC laptop where I discovered The assert that fails is in a Py_SAFEDOWNCAST macro. I have *no* idea where to start with this one; |
Logged In: YES Fails for me too (Win2k, python debug build). But it is a The debugger shows that w_long is called with x = 128, and |
Logged In: YES As I can see, the proper fix is to replace static void
w_long(long x, WFILE *p)
{
w_byte((int)( x & 0xff), p);
w_byte((int)((x>> 8) & 0xff), p);
w_byte((int)((x>>16) & 0xff), p);
w_byte((int)((x>>24) & 0xff), p);
} with static void
w_long(long x, WFILE *p)
{
w_byte((char)( x & 0xff), p);
w_byte((char)((x>> 8) & 0xff), p);
w_byte((char)((x>>16) & 0xff), p);
w_byte((char)((x>>24) & 0xff), p);
} and similar for the w_short() function. |
Logged In: YES That fixes both my initial problem and your test case. Nice Check it in and add a test case? It would be nice to have w_byte as an inline function with |
Logged In: YES Check in and added test case: committed * Up-To-Date 1.3 Lib/test/test_marshal.py |
Logged In: YES Nice work guys! (Now I wonder where Py_SAFE_DOWNCAST comes from. :-) |
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: