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

Crash when using pickle and ElementTree #63197

Closed
Kronuz mannequin opened this issue Sep 10, 2013 · 6 comments
Closed

Crash when using pickle and ElementTree #63197

Kronuz mannequin opened this issue Sep 10, 2013 · 6 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@Kronuz
Copy link
Mannequin

Kronuz mannequin commented Sep 10, 2013

BPO 18997
Nosy @scoder, @Kronuz
Files
  • houses.xml: XML test file
  • join_obj.diff: Fixes getstate/setstate
  • 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 = None
    closed_at = <Date 2013-09-13.13:28:41.617>
    created_at = <Date 2013-09-10.13:49:20.540>
    labels = ['extension-modules', 'type-bug']
    title = 'Crash when using pickle and ElementTree'
    updated_at = <Date 2013-09-18.10:13:36.652>
    user = 'https://github.com/Kronuz'

    bugs.python.org fields:

    activity = <Date 2013-09-18.10:13:36.652>
    actor = 'python-dev'
    assignee = 'eli.bendersky'
    closed = True
    closed_date = <Date 2013-09-13.13:28:41.617>
    closer = 'eli.bendersky'
    components = ['Extension Modules']
    creation = <Date 2013-09-10.13:49:20.540>
    creator = 'Kronuz'
    dependencies = []
    files = ['31719', '31725']
    hgrepos = []
    issue_num = 18997
    keywords = ['patch']
    message_count = 6.0
    messages = ['197440', '197452', '197455', '197568', '197570', '198012']
    nosy_count = 5.0
    nosy_names = ['scoder', 'Arfrever', 'eli.bendersky', 'python-dev', 'Kronuz']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18997'
    versions = ['Python 3.3', 'Python 3.4']

    @Kronuz
    Copy link
    Mannequin Author

    Kronuz mannequin commented Sep 10, 2013

    On the tip of 3.3, I've found Element.__getstate__ doesn't work and neither as pickle.dumps(Element) under certain circumstances.

    This crashes:
    e1 = ElementTree().parse('houses.xml')
    e1.__getstate__()

    This doesn't crash:
    e2 = ElementTree().parse('houses.xml')
    e2.text = 'some'
    e2.__getstate__()

    But still, both of these crash:
    pickle.dumps(e1)
    pickle.dumps(e2)

    @Kronuz Kronuz mannequin added the extension-modules C modules in the Modules dir label Sep 10, 2013
    @Kronuz
    Copy link
    Mannequin Author

    Kronuz mannequin commented Sep 10, 2013

    The attached patch fixes the problem (there were some missing JOIN_OBJ())

    @elibendersky
    Copy link
    Mannequin

    elibendersky mannequin commented Sep 10, 2013

    Thanks for this report, Germán (and the other issue as well). I'll do my best to take a look later this week.

    @elibendersky elibendersky mannequin self-assigned this Sep 10, 2013
    @elibendersky elibendersky mannequin added the type-bug An unexpected behavior, bug, or error label Sep 10, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 13, 2013

    New changeset 39823ebfc731 by Eli Bendersky in branch '3.3':
    Issue bpo-18997: fix ElementTree crash with using pickle and __getstate__.
    http://hg.python.org/cpython/rev/39823ebfc731

    New changeset bda5a87df1c8 by Eli Bendersky in branch 'default':
    Merge for Issue bpo-18997: Issue bpo-18997: fix ElementTree crash with using pickle and __getstate__.
    http://hg.python.org/cpython/rev/bda5a87df1c8

    @elibendersky
    Copy link
    Mannequin

    elibendersky mannequin commented Sep 13, 2013

    Fixed the patch and committed. Thanks.

    @elibendersky elibendersky mannequin closed this as completed Sep 13, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 18, 2013

    New changeset 111a74819192 by doko in branch '3.3':

    New changeset 269be4aacb8e by doko in branch 'default':

    @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
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants