-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
%lld for PyErr_Format (Modules/_io/bufferedio.c) #51477
Comments
Hello. There is following sentence in Modules/_io/bufferedio.c, PyErr_Format(PyExc_IOError, and PY_PRIdOFF == "lld" when sizeof(off_t) == sizeof(long long). But it seems that PyErr_Format doesn't support lld as specifier. I noticed this because |
I believe r75728 and r75879 are related. |
Thanks for reporting this. Do you know what the right conversion specifier is for print(f)ing |
The 'long long' define should have been PY_LONG_LONG. I don't know what |
MSVC6 uses __int64 as 64bit integer, and printf uses "I64" as its specifier. |
So PY_PRIdOFF should be "I64d"? Or just "I64"? |
Oh, I was late. I agree with msg94605. printf("%I64d\n", 1I64 << 40); /* 1099511627776 */ So if PyErr_Format (actually, PyString_FromFormatV) will support #define PY_FORMAT_LONG_LONG "I64" /* On Windows */
#define PY_FORMAT_LONG_LONG "ll" /* On Unix */ |
I was late again...? Hmm, I thought Python tracker told me that somebody But PyErr_Format actually calls PyString_FromFormatV, and it's not |
Thanks. I'm just going to fix Modules/io/_iomodule.h for now. But I I also notice there are some uses of "%zd" in Modules/io that should be |
Aargh. You're right, of course. PyString_FromFormatV needs to be I'll look at this later today. |
Sorry for confusion. I shouldn't have said last 3 lines in msg94601. :-( |
I've rolled back all the changes I made trying to fix these format I agree that what's needed here is %lld and %llu support in PyErr_Format ocean-city: you don't happen to have a patch available, do you? |
No, I don't have it. |
Patch to add %lld support to PyString_FromFormat(V). (Against the trunk.) |
I tried your patch on windows, your patch worked great. One little |
Added extra #ifdef HAVE_LONG_LONG as suggested. Committed to trunk in r76308. I'm working on the merge to py3k, which |
Just so I don't lose it, here's the current version of the forward merge In testing this, I found some other possible bugs in the py3k |
Merged to py3k in r76328. |
ocean-city, now that "lld" and "llu" support has been added, could you |
I think your patch is correct. (I couldn't check the behavior on error |
Thanks for testing! Fixed (again) in r76502 (trunk), r76503 (py3k). I don't think it's worth |
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: