msg138781 - (view) |
Author: Robin Jarry (Robin.Jarry) |
Date: 2011-06-21 12:12 |
When trying to open a non existing MSI database, an obscure "unknown error 6e" is raised. Could it be possible to get a more explicit message such as "File not found" or whatever ? Thanks :) Here is a example: -------------------------------- D:\>ll total 0 drwxr-xr-x 4 tcinteg Administ 0 Nov 30 2010 RECYCLER drwxr-xr-x 0 tcinteg Administ 0 Jul 6 2009 System Volume Information drwxr-xr-x 4 tcinteg Administ 0 Apr 29 16:03 TC drwxr-xr-x 3 tcinteg Administ 0 Apr 29 15:43 stgloc D:\>python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import msilib >>> db = msilib.OpenDatabase("I_Do_Not_Exist.msi", msilib.MSIDBOPEN_READONLY) Traceback (most recent call last): File "", line 1, in _msi.MSIError: unknown error 6e >>> |
|
|
msg138782 - (view) |
Author: Robin Jarry (Robin.Jarry) |
Date: 2011-06-21 12:18 |
changed the headline of the defect for something more meaningful :) |
|
|
msg139024 - (view) |
Author: Mark Mc Mahon (markm) * |
Date: 2011-06-25 08:10 |
The following two error conditions that can be returned by MsiOpenDatabase do not have specific handling: ERROR_CREATE_FAILED (1631) The database could not be created. ERROR_OPEN_FAILED (110) The database could not be opened as requested. (the messages are those copied from MSDN). Should extra cases for these go into the case statement in msierror? or should they be handled directly in OpenDatabase. Does the error text above sound OK - should we add ": '%s'" % msi_file ? |
|
|
msg139049 - (view) |
Author: Robin Jarry (Robin.Jarry) |
Date: 2011-06-25 12:14 |
This sounds OK as long as the error message is explicit :) |
|
|
msg139203 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2011-06-26 19:49 |
I'd add them to msierror, with no inclusion of the file name. If you want the file name in the exception, you should uniformly apply this to all errors in OpenDatabase, and then subclass MSIError to, say, MSIOpenError which includes a .filename attribute. |
|
|
msg217552 - (view) |
Author: William Tisäter (tiwilliam) * |
Date: 2014-04-29 21:09 |
Found this a simple fix for an annoying and time consuming error. Patched as discussed earlier and decided to leave the filename out. |
|
|
msg306880 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2017-11-24 09:54 |
New changeset 4864a619dc1cc9092780ccf5a6327e8abf66133d by Berker Peksag in branch 'master': bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528) https://github.com/python/cpython/commit/4864a619dc1cc9092780ccf5a6327e8abf66133d |
|
|
msg306883 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2017-11-24 10:31 |
New changeset bfa89b21e119bac7fed4a5decc26f1fff8ec359e by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528) https://github.com/python/cpython/commit/bfa89b21e119bac7fed4a5decc26f1fff8ec359e |
|
|
msg306884 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2017-11-24 10:32 |
Thank you for your patch, William. I added a test case, a NEWS entry and committed it to 3.6 and master branches. |
|
|