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

xml.sax.parse won't accept path objects #75839

Closed
craigh mannequin opened this issue Oct 1, 2017 · 4 comments
Closed

xml.sax.parse won't accept path objects #75839

craigh mannequin opened this issue Oct 1, 2017 · 4 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-bug An unexpected behavior, bug, or error

Comments

@craigh
Copy link
Mannequin

craigh mannequin commented Oct 1, 2017

BPO 31658
Nosy @pitrou, @scoder, @mcepl
PRs
  • bpo-31658: Make xml.sax.parse accepting Path objects #8564
  • 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 2019-04-14.09:18:08.566>
    created_at = <Date 2017-10-01.20:51:11.544>
    labels = ['expert-XML', '3.8', 'type-bug', 'library']
    title = "xml.sax.parse won't accept path objects"
    updated_at = <Date 2019-04-14.09:18:33.555>
    user = 'https://bugs.python.org/craigh'

    bugs.python.org fields:

    activity = <Date 2019-04-14.09:18:33.555>
    actor = 'scoder'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-14.09:18:08.566>
    closer = 'scoder'
    components = ['Library (Lib)', 'XML']
    creation = <Date 2017-10-01.20:51:11.544>
    creator = 'craigh'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31658
    keywords = ['patch']
    message_count = 4.0
    messages = ['303490', '340197', '340198', '340199']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'scoder', 'mcepl', 'craigh']
    pr_nums = ['8564']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31658'
    versions = ['Python 3.8']

    @craigh
    Copy link
    Mannequin Author

    craigh mannequin commented Oct 1, 2017

    >>> import xml.sax
    >>> import pathlib
    [...]
    >>> xml.sax.parse(pathlib.Path('path/to/file'), handler)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.6/xml/sax/__init__.py", line 33, in parse
        parser.parse(source)
      File "/usr/lib/python3.6/xml/sax/expatreader.py", line 105, in parse
        source = saxutils.prepare_input_source(source)
      File "/usr/lib/python3.6/xml/sax/saxutils.py", line 355, in prepare_input_source
        if source.getCharacterStream() is None and source.getByteStream() is None:
    AttributeError: 'PosixPath' object has no attribute 'getCharacterStream'

    @craigh craigh mannequin added stdlib Python modules in the Lib dir topic-XML type-bug An unexpected behavior, bug, or error labels Oct 1, 2017
    @BoboTiG BoboTiG mannequin added 3.7 (EOL) end of life 3.8 only security fixes labels Jan 14, 2019
    @scoder
    Copy link
    Contributor

    scoder commented Apr 14, 2019

    PR looks good to me. Doesn't look critical enough for a backport, though.

    @scoder scoder removed the 3.7 (EOL) end of life label Apr 14, 2019
    @scoder
    Copy link
    Contributor

    scoder commented Apr 14, 2019

    New changeset 929b704 by Stefan Behnel (Mickaël Schoentgen) in branch 'master':
    bpo-31658: Make xml.sax.parse accepting Path objects (GH-8564)
    929b704

    @scoder scoder closed this as completed Apr 14, 2019
    @scoder
    Copy link
    Contributor

    scoder commented Apr 14, 2019

    Thanks for your contribution.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant