classification
Title: Make xml.sax.make_parser accept iterables
Type: enhancement Stage: resolved
Components: XML Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: adelfino, docs@python, fdrake, miss-islington, taleinat
Priority: normal Keywords: patch

Created on 2018-09-24 16:04 by adelfino, last changed 2018-10-26 14:57 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9542 merged adelfino, 2018-09-24 16:06
PR 9576 merged adelfino, 2018-09-25 18:40
PR 10123 merged miss-islington, 2018-10-26 13:12
PR 10124 merged miss-islington, 2018-10-26 13:12
Messages (11)
msg326261 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-09-24 16:04
Doc says:

"If parser_list is provided, it must be a *sequence* of strings which name modules that have a function named create_parser()"

but code concatenas parser_list with an existing list:

for parser_name in parser_list + default_parser_list:

Fix this by stating parser_list must be a specific kind of sequence, that is, a list.
msg326262 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2018-09-24 16:24
I'm just going to presume this issue has been around a long time, but I think that's a pretty safe presumption.

Accepting a general sequence instead of only a list would reasonable, and I'd support a fix that caused the code to accept a general sequence (or any iterable) by calling list() on the passed-in value, starting with 3.8.

The patch provided looks good for versions in maintenance.  (It would also be fine for 3.8 if there's no interest in generalizing the code to accept arbitrary iterables).
msg326279 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-09-24 18:16
I think it makes sense for make_parser to accept any iterable too. I'll update the PR when I have the testcase ready.
msg326280 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2018-09-24 18:44
It probably makes more sense to keep that PR for the maintenance branches, and create a new branch / PR to land on master.
msg326283 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-09-24 19:33
Admittedly, my Git-fu is not strong, but since the PR was opened against master, and given that the PR as is won't be merged to master, can it still be "backported" to 3.7, 3.6, and 2.7?

Shouldn't I update the PR so it can be merged to master (that won't be backported), and then open a new PR against 3.7 that will be backported to 3.6 and 2.7?
msg326285 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2018-09-24 20:51
The existing PR can be re-targeted to merge to a maintenance branch (I'd be inclined to merge manually, myself, but will have to check the current devguide to make sure that's still allowed).

A new PR can be made for the non-documentation fix for master.

My thought is that a PR is more about the patch than about the workflow; a different patch can be handled in a separate PR, and review & discussion are used to determine which PR should be applied where.
msg328544 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-26 13:12
New changeset 1487b651caa62647f8f8c9e8432e475e3566130c by Tal Einat (Andrés Delfino) in branch '3.7':
[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)
https://github.com/python/cpython/commit/1487b651caa62647f8f8c9e8432e475e3566130c
msg328545 - (view) Author: miss-islington (miss-islington) Date: 2018-10-26 13:27
New changeset 38d7620baab96c702243cfa193377a38888ec10f by Miss Islington (bot) in branch '3.6':
[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)
https://github.com/python/cpython/commit/38d7620baab96c702243cfa193377a38888ec10f
msg328546 - (view) Author: miss-islington (miss-islington) Date: 2018-10-26 13:29
New changeset 9dcb517f8ebba16a46ec2a6a97bb3e4a97daeae9 by Miss Islington (bot) in branch '2.7':
[3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542)
https://github.com/python/cpython/commit/9dcb517f8ebba16a46ec2a6a97bb3e4a97daeae9
msg328555 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-26 14:57
New changeset a6dc531063efe3a8d47ff4639729060c72a3688c by Tal Einat (Andrés Delfino) in branch 'master':
bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576)
https://github.com/python/cpython/commit/a6dc531063efe3a8d47ff4639729060c72a3688c
msg328556 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-26 14:57
Thanks for reporting the issue and making the PRs, Andrés!
History
Date User Action Args
2018-10-26 14:57:58taleinatsetstatus: open -> closed
resolution: fixed
messages: + msg328556

stage: patch review -> resolved
2018-10-26 14:57:02taleinatsetmessages: + msg328555
2018-10-26 13:29:47miss-islingtonsetmessages: + msg328546
2018-10-26 13:27:22miss-islingtonsetnosy: + miss-islington
messages: + msg328545
2018-10-26 13:12:38miss-islingtonsetpull_requests: + pull_request9456
2018-10-26 13:12:26miss-islingtonsetpull_requests: + pull_request9455
2018-10-26 13:12:06taleinatsetnosy: + taleinat
messages: + msg328544
2018-09-25 18:56:52adelfinosetcomponents: + XML, - Library (Lib)
2018-09-25 18:55:51adelfinosetcomponents: + Library (Lib), - Documentation
title: doc xml.sax.make_parser expects a list not just any sequence -> Make xml.sax.make_parser accept iterables
2018-09-25 18:40:43adelfinosetpull_requests: + pull_request8978
2018-09-24 20:51:21fdrakesetmessages: + msg326285
2018-09-24 19:33:47adelfinosetmessages: + msg326283
2018-09-24 18:44:54fdrakesetmessages: + msg326280
2018-09-24 18:16:19adelfinosetmessages: + msg326279
2018-09-24 16:24:40fdrakesetnosy: + fdrake
messages: + msg326262
2018-09-24 16:06:06adelfinosetkeywords: + patch
stage: patch review
pull_requests: + pull_request8944
2018-09-24 16:04:07adelfinocreate