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
Nonsense errors reported by msilib.FCICreate for bad argument #66130
Comments
The function fcicreate in PC/_msi.c can return nonsense if the list of files passed to msilib.FCICreate does not contains tuples as expected. To replicate, import msilib
msilib.FCICreate("test.cab", ["entry.txt"]) The above code will return a ValueError of the format: ValueError: FCI error 11260524 The error code is meaningless. If one were to examine the code, you can see in PC/_msi.c:246 (in "current"):
If we look at the error handler at PC/_msi.c:262, it assumes that one of the Windows MSI API calls had failed, and will print the contents of the ERF error structure: err: In the case where the list does not contain tuples, the value of erf.erfOper was never initialized or set because the error being raised is not due to the Windows MSI API. The error is highly misleading as it is simply an argument error. |
Do you want to propose a patch? |
Attached a patch. The dangers of using goto... |
mslib doesn't have many tests, but it looks like it would be easy enough to add one for this? |
Is this patch going to be accepted? It fixes actual incorrect code in msilib, and it seems to have stagnated |
I haven't had any time to work on Python in the last year, so it may take some more time for me to look into this. |
There's not much to look into. If the Python function encounters an argument error, it returns an uninitialized integer as an "error code." This patch fixes incorrect C code, nothing more. |
Right, the entire patch might be processed in 30 minutes. I won't have these 30 minutes any time soon. |
I thought, while I'm here reporting another bug, I'd bump this once more. There is a patch here, and it corrects clearly broken code. Should I mark this as "won't fix?" |
I'll try to have a look at this later today, but unfortunately can't |
New changeset 41281737d71a by Zachary Ware in branch '3.4': New changeset cb0d1d86215e by Zachary Ware in branch 'default': |
It's a simple enough fix, so I went ahead and committed it. Thanks for the patch! I've created bpo-24224 to track the addition of tests to test_msilib (for more than just this issue). |
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: