[issue34789] doc xml.sax.make_parser expects a list not just any sequence
New submission from Andrés Delfino <adelfino@gmail.com>: 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. ---------- assignee: docs@python components: Documentation messages: 326261 nosy: adelfino, docs@python priority: normal severity: normal status: open title: doc xml.sax.make_parser expects a list not just any sequence type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by Andrés Delfino <adelfino@gmail.com>: ---------- keywords: +patch pull_requests: +8944 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Fred L. Drake, Jr. <fdrake@gmail.com> added the comment: 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). ---------- nosy: +fdrake _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Andrés Delfino <adelfino@gmail.com> added the comment: I think it makes sense for make_parser to accept any iterable too. I'll update the PR when I have the testcase ready. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Fred L. Drake, Jr. <fdrake@gmail.com> added the comment: It probably makes more sense to keep that PR for the maintenance branches, and create a new branch / PR to land on master. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Andrés Delfino <adelfino@gmail.com> added the comment: 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? ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Fred L. Drake, Jr. <fdrake@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by Andrés Delfino <adelfino@gmail.com>: ---------- pull_requests: +8978 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by Andrés Delfino <adelfino@gmail.com>: ---------- components: +Library (Lib) -Documentation title: doc xml.sax.make_parser expects a list not just any sequence -> Make xml.sax.make_parser accept iterables _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by Andrés Delfino <adelfino@gmail.com>: ---------- components: +XML -Library (Lib) _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Tal Einat <taleinat@gmail.com> added the comment: 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/1487b651caa62647f8f8c9e8432e475e356... ---------- nosy: +taleinat _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +9455 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +9456 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/38d7620baab96c702243cfa193377a38888... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/9dcb517f8ebba16a46ec2a6a97bb3e4a97d... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Tal Einat <taleinat@gmail.com> added the comment: 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/a6dc531063efe3a8d47ff4639729060c72a... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
Tal Einat <taleinat@gmail.com> added the comment: Thanks for reporting the issue and making the PRs, Andrés! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34789> _______________________________________
participants (4)
-
Andrés Delfino -
Fred L. Drake, Jr. -
miss-islington -
Tal Einat