classification
Title: Add support for _msi.Record.GetString() and _msi.Record.GetInteger()
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: atuining, berker.peksag, loewis, steve.dower, tim.golden, uday kiran, zach.ware
Priority: high Keywords: patch

Created on 2007-09-04 21:01 by atuining, last changed 2017-11-23 14:34 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
_msi.patch.txt atuining, 2008-10-20 18:47 Patch to fix fetching from views
_msi_fetch.patch.txt atuining, 2012-03-12 17:52 Simplified patch for fixing fetching from views (against 2.7.2)
Pull Requests
URL Status Linked Edit
PR 4459 merged berker.peksag, 2017-11-19 06:51
PR 4520 merged berker.peksag, 2017-11-23 13:22
Messages (16)
msg55644 - (view) Author: Anthony Tuininga (atuining) * Date: 2007-09-04 21:06
Attached is a patch that adds the requested support. This is in relation
to the thread at

http://www.gossamer-threads.com/lists/python/python/584264

In addition to the two methods I also "fixed" Fetch() by ensuring that
when the records are exhausted None is returned instead of an error.

If something further is required of me or I submitted this patch
incorrectly, please let me know so I don't screw it up next time. :-)
msg67691 - (view) Author: Anthony Tuininga (atuining) * Date: 2008-06-04 13:56
This patch appears to be mostly duplicated by patch 2125 which has been
accepted. Would it be helpful if I separated out the parts that have now
been accepted?
msg67694 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-06-04 18:47
Yes, please do provide an updated patch.
msg75000 - (view) Author: Anthony Tuininga (atuining) * Date: 2008-10-20 18:47
With apologies for the delay, I have modified the patch to remove the
stuff that has been added already. Some of the other changes are to make
use of new C API functionality but they can be ignored, if desired. The
changes that are relevant are in the view_fetch() routine. Again, if you
have questions, let me know.
msg138211 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-06-12 18:46
Martin, would this go in a bugfix release or is it a new feature for 3.3 only?
msg138212 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-06-12 18:52
I lost track what problem precisely this patch solves, so it's hard to tell whether it's a bug fix or not.
msg155456 - (view) Author: Anthony Tuininga (atuining) * Date: 2012-03-12 17:52
All, I have trimmed this patch down to the bare minimum required to solve this problem. Please review this as I would dearly love to have this committed. The error received without this patch is

MSIError: unknown error 103

This occurs when there are no more records to fetch from the view. The patch simply returns None when there are no more records to fetch -- similar to what is done by the DB API.
msg220649 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-15 16:23
Can someone review the latest patch please as it's only five additional lines of C code.
msg225877 - (view) Author: Anthony Tuininga (atuining) * Date: 2014-08-25 15:02
I note that this patch has still not been accepted! Please let me know what needs to be done. I just tried against Python 3.4 and the patch works as expected -- other than the starting line number is now 715. I have signed the contributor agreement if that is what is holding things up.
msg226053 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-08-29 05:51
Sorry, I have no familiarity with msilib, _msi, or the internals of MSIs in general.  The patch looks reasonably harmless to me, but I don't have the confidence to take responsibility for it.
msg306498 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-19 06:56
I've opened PR 4459 to fix this. Here's a simple reproducer I adapted from the script uploaded by uday kiran in issue 32064.
msg306814 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 12:47
New changeset bdb8315c21825487b54852ff0511fb4881ea2181 by Berker Peksag in branch 'master':
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
https://github.com/python/cpython/commit/bdb8315c21825487b54852ff0511fb4881ea2181
msg306816 - (view) Author: uday kiran (uday kiran) * Date: 2017-11-23 13:23
Will it be added to 3.6 also?
And when it will be available in the windows installations you release?
msg306817 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 13:27
> Will it be added to 3.6 also?

Yes, I've created a backport PR: PR 4520

> And when it will be available in the windows installations you release?

The dates for 3.6.4 release is listed at https://www.python.org/dev/peps/pep-0494/#id4
msg306821 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 14:33
New changeset 4b3042900e7e8dc120408bab86642c09c9d25a5a by Berker Peksag in branch '3.6':
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
https://github.com/python/cpython/commit/4b3042900e7e8dc120408bab86642c09c9d25a5a
msg306822 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 14:34
Thank you, Anthony. I added a test case and committed your patch to 3.6 and master branches.
History
Date User Action Args
2017-11-23 14:34:19berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg306822

stage: patch review -> resolved
2017-11-23 14:33:14berker.peksagsetmessages: + msg306821
2017-11-23 13:27:30berker.peksagsetmessages: + msg306817
2017-11-23 13:23:58uday kiransetmessages: + msg306816
2017-11-23 13:22:18berker.peksagsetstage: backport needed -> patch review
pull_requests: + pull_request4457
2017-11-23 12:48:15berker.peksagsetstage: patch review -> backport needed
versions: - Python 2.7
2017-11-23 12:47:35berker.peksagsetmessages: + msg306814
2017-11-19 13:54:54BreamoreBoysetnosy: - BreamoreBoy
2017-11-19 06:56:35berker.peksagsetnosy: + berker.peksag, uday kiran

messages: + msg306498
versions: + Python 3.6, Python 3.7, - Python 3.4, Python 3.5
2017-11-19 06:51:48berker.peksaglinkissue32064 superseder
2017-11-19 06:51:01berker.peksagsetkeywords: + patch
pull_requests: + pull_request4396
2017-02-01 19:34:04berker.peksaglinkissue29364 superseder
2014-08-29 05:51:17zach.waresetmessages: + msg226053
2014-08-25 15:02:23atuiningsetmessages: + msg225877
2014-06-15 18:24:49terry.reedysetnosy: - terry.reedy
2014-06-15 16:23:35BreamoreBoysetnosy: + BreamoreBoy, zach.ware, steve.dower

messages: + msg220649
versions: + Python 3.4, Python 3.5, - Python 3.2, Python 3.3
2012-03-12 17:52:23atuiningsetfiles: + _msi_fetch.patch.txt

messages: + msg155456
2011-06-12 18:52:16loewissetmessages: + msg138212
2011-06-12 18:46:08terry.reedysetnosy: + terry.reedy

messages: + msg138211
versions: + Python 3.3, - Python 3.1
2010-08-16 16:17:20tim.goldensetnosy: + tim.golden
components: + Windows
2010-08-16 16:14:17BreamoreBoysetstage: patch review
type: behavior
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2008-10-20 21:33:21loewissetpriority: normal -> high
2008-10-20 18:47:46atuiningsetfiles: + _msi.patch.txt
messages: + msg75000
versions: + Python 2.6, - Python 2.5
2008-10-20 18:45:10atuiningsetfiles: - _msi.patch.txt
2008-06-04 18:47:53loewissetmessages: + msg67694
2008-06-04 13:56:21atuiningsetmessages: + msg67691
2007-09-17 08:08:43jafosetpriority: normal
2007-09-04 21:35:57loewissetassignee: loewis
nosy: + loewis
2007-09-04 21:10:28atuiningsettype: behavior -> (no value)
2007-09-04 21:06:50atuiningsetfiles: + _msi.patch.txt
nosy: + atuining
messages: + msg55644
2007-09-04 21:01:54atuiningcreate