Skip to content
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

Add support for _msi.Record.GetString() and _msi.Record.GetInteger() #45443

Closed
atuining mannequin opened this issue Sep 4, 2007 · 16 comments
Closed

Add support for _msi.Record.GetString() and _msi.Record.GetInteger() #45443

atuining mannequin opened this issue Sep 4, 2007 · 16 comments
Assignees
Labels
3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@atuining
Copy link
Mannequin

atuining mannequin commented Sep 4, 2007

BPO 1102
Nosy @loewis, @tjguk, @berkerpeksag, @zware, @zooba
PRs
  • bpo-1102: View.Fetch() now returns None when it's exhausted #4459
  • [3.6] bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459) #4520
  • Files
  • _msi.patch.txt: Patch to fix fetching from views
  • _msi_fetch.patch.txt: Simplified patch for fixing fetching from views (against 2.7.2)
  • 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:

    assignee = 'https://github.com/loewis'
    closed_at = <Date 2017-11-23.14:34:19.799>
    created_at = <Date 2007-09-04.21:01:54.634>
    labels = ['3.7', 'type-bug', 'library', 'OS-windows']
    title = 'Add support for _msi.Record.GetString() and _msi.Record.GetInteger()'
    updated_at = <Date 2017-11-23.14:34:19.798>
    user = 'https://bugs.python.org/atuining'

    bugs.python.org fields:

    activity = <Date 2017-11-23.14:34:19.798>
    actor = 'berker.peksag'
    assignee = 'loewis'
    closed = True
    closed_date = <Date 2017-11-23.14:34:19.799>
    closer = 'berker.peksag'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2007-09-04.21:01:54.634>
    creator = 'atuining'
    dependencies = []
    files = ['11840', '24795']
    hgrepos = []
    issue_num = 1102
    keywords = ['patch']
    message_count = 16.0
    messages = ['55644', '67691', '67694', '75000', '138211', '138212', '155456', '220649', '225877', '226053', '306498', '306814', '306816', '306817', '306821', '306822']
    nosy_count = 7.0
    nosy_names = ['loewis', 'atuining', 'tim.golden', 'berker.peksag', 'zach.ware', 'steve.dower', 'uday kiran']
    pr_nums = ['4459', '4520']
    priority = 'high'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1102'
    versions = ['Python 3.6', 'Python 3.7']

    @atuining atuining mannequin added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Sep 4, 2007
    @atuining
    Copy link
    Mannequin Author

    atuining mannequin commented Sep 4, 2007

    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. :-)

    @atuining atuining mannequin removed the type-bug An unexpected behavior, bug, or error label Sep 4, 2007
    @loewis loewis mannequin self-assigned this Sep 4, 2007
    @atuining
    Copy link
    Mannequin Author

    atuining mannequin commented Jun 4, 2008

    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?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jun 4, 2008

    Yes, please do provide an updated patch.

    @atuining
    Copy link
    Mannequin Author

    atuining mannequin commented Oct 20, 2008

    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.

    @BreamoreBoy BreamoreBoy mannequin added the type-bug An unexpected behavior, bug, or error label Aug 16, 2010
    @terryjreedy
    Copy link
    Member

    Martin, would this go in a bugfix release or is it a new feature for 3.3 only?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jun 12, 2011

    I lost track what problem precisely this patch solves, so it's hard to tell whether it's a bug fix or not.

    @atuining
    Copy link
    Mannequin Author

    atuining mannequin commented Mar 12, 2012

    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.

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jun 15, 2014

    Can someone review the latest patch please as it's only five additional lines of C code.

    @atuining
    Copy link
    Mannequin Author

    atuining mannequin commented Aug 25, 2014

    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.

    @zware
    Copy link
    Member

    zware commented Aug 29, 2014

    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.

    @berkerpeksag
    Copy link
    Member

    I've opened PR 4459 to fix this. Here's a simple reproducer I adapted from the script uploaded by uday kiran in bpo-32064.

    @berkerpeksag berkerpeksag added the 3.7 (EOL) end of life label Nov 19, 2017
    @berkerpeksag
    Copy link
    Member

    New changeset bdb8315 by Berker Peksag in branch 'master':
    bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
    bdb8315

    @udaykiran
    Copy link
    Mannequin

    udaykiran mannequin commented Nov 23, 2017

    Will it be added to 3.6 also?
    And when it will be available in the windows installations you release?

    @berkerpeksag
    Copy link
    Member

    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

    @berkerpeksag
    Copy link
    Member

    New changeset 4b30429 by Berker Peksag in branch '3.6':
    bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
    4b30429

    @berkerpeksag
    Copy link
    Member

    Thank you, Anthony. I added a test case and committed your patch to 3.6 and master branches.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants