Issue 14679: Define an all for html.parser (original) (raw)

Created on 2012-04-26 20:06 by vinay.sajip, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue14679.diff ezio.melotti,2013-03-29 23:53 review
Messages (6)
msg159421 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-04-26 20:06
The change to html.parser.tagfind in ba4baaddac8d is causing third-party code (Django) to fail. See http://mail.python.org/pipermail/python-dev/2012-April/119074.html for more information. Other patterns which changed (e.g. attrfind_tolerant) might also lead to problems. As suggested in the python-dev thread, private versions of these patterns should be used and the existing public ones deprecated, where appropriate.
msg171353 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-09-26 18:43
The issue with Django seems to be solved, but as Terry suggested in http://mail.python.org/pipermail/python-dev/2012-April/119087.html, adding an __all__ would be a good idea. I'm changing the scope of the issue accordingly.
msg171423 - (view) Author: Michele OrrĂ¹ (maker) * Date: 2012-09-28 09:29
"# Internal" appears only in HTMLParser's methods; how could __all__ fix this?
msg185528 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-29 23:53
The module only defines 2 public objects: HTMLParser and HTMLParseError. The attached patch adds an __all__ with only HTMLParser. Should HTMLParseError be included too, even though it's deprecated and will be removed in 3.5? @Michele: __all__ won't fix that, but at least it will make clear that the module-level regex (like tagfind) are not public. Renaming the methods is not a good idea IMHO, we could move the "# internal" comments in the docstrings though.
msg185789 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-04-02 01:44
I think, HTMLParseError should also be defined __all__ (all also servers as what public classes/methods to look for sometimes and sets some expectation while reading the code.) There is no deprecation warning added in the class here.
msg188220 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-01 13:09
New changeset 1f7ce8af3356 by Ezio Melotti in branch 'default': #14679: add an __all__ (that contains only HTMLParser) to html.parser. http://hg.python.org/cpython/rev/1f7ce8af3356
History
Date User Action Args
2022-04-11 14:57:29 admin set github: 58884
2013-05-01 13:11:38 ezio.melotti set status: open -> closedresolution: fixedstage: patch review -> resolved
2013-05-01 13:09:49 python-dev set nosy: + python-devmessages: +
2013-04-02 01:44:34 orsenthil set nosy: + orsenthilmessages: +
2013-03-29 23:53:43 ezio.melotti set files: + issue14679.diffkeywords: + patchmessages: + stage: needs patch -> patch review
2012-09-28 09:29:52 maker set nosy: + makermessages: +
2012-09-26 18:43:32 ezio.melotti set versions: + Python 3.4, - Python 3.3title: Changes to html.parser break third-party code -> Define an __all__ for html.parsermessages: + assignee: ezio.melotticomponents: + Library (Lib)stage: needs patch
2012-04-26 20:11:42 eric.araujo set nosy: + eric.araujo
2012-04-26 20:06:12 vinay.sajip create