Issue 15114: Deprecate strict mode of HTMLParser (original) (raw)

Created on 2012-06-20 09:42 by ezio.melotti, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue15114.diff ezio.melotti,2012-06-21 14:50 review
issue15114-2.diff ezio.melotti,2012-10-11 12:00 Patch for 3.4. review
issue15114-3.diff ezio.melotti,2013-11-07 16:43 Patch for 3.5. review
Messages (12)
msg163265 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-06-20 09:42
The deprecation plan for the strict mode of HTMLParser might be as follow: 3.3 (before the beta) strict=False default strict arg deprecated in the doc strict=True deprecated (raises a warning) HTMLParseError deprecated HTMLParser.error deprecated (raises a warning) calls to HTMLParser.error removed/converted to asserts 3.4 strict arg deprecated (raises a warning) 3.5 strict arg removed and strict code removed HTMLParseError removed HTMLParser.error removed Everything that is parsed by strict=True is parsed by strict=False too, so changing the default shouldn't be a problem. The difference is that strict=False won't raise any error and will parse broken markup too. Given that no errors are raised HTMLParseError and HTMLParser.error become useless and can be deprecated (3.3) and removed (3.5) too. Once strict=False is the default (3.3), the instances should be created simply with HTMLParser(), and eventually the strict argument will be deprecated (3.4) and removed (3.5).
msg163273 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-20 12:38
Your plan sounds fine to me.
msg163337 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-06-21 14:50
The attached patch include these changes: * strict=False default * strict arg deprecated in the doc * strict=True deprecated (raises a warning) * HTMLParseError deprecated in the doc * some calls to HTMLParser.error converted to asserts [0] Regarding * HTMLParser.error deprecated (raises a warning) I'm not sure anymore that's a good idea. The method is not documented, so in theory it could be removed without deprecation warnings, but that might break things if someone is using it. [0] I made a mistake in my first message: some of the calls should actually be converted to assert, the others will stay as long as the strict mode exists (i.e. they will be removed in 3.5)
msg163570 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-06-23 10:14
Why not deprecate .error()? Removing it immediately as undocumented is certainly not better. Otherwise sounds good, please commit.
msg163604 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-06-23 13:21
Regarding .error() I think the best thing to do is wait till 3.4 and then deprecate it.
msg163605 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-06-23 13:28
New changeset 8dd2f5754b2f by Ezio Melotti in branch 'default': #15114: the strict mode of HTMLParser and the HTMLParseError exception are deprecated now that the parser is able to parse invalid markup. http://hg.python.org/cpython/rev/8dd2f5754b2f
msg163608 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-06-23 13:34
3.3 is done. 3.4 strict arg deprecated (raises a warning) HTMLParser.error deprecated (raises a warning) 3.5 strict arg removed and strict code removed HTMLParseError removed HTMLParser.error and calls to HTMLParser.error removed
msg201976 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-02 15:08
New changeset 0a56709eb798 by Ezio Melotti in branch 'default': #15114: The html.parser module now raises a DeprecationWarning when the strict argument of HTMLParser or the HTMLParser.error method are used. http://hg.python.org/cpython/rev/0a56709eb798
msg202363 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-11-07 16:43
3.4 is done. 3.5 strict arg removed and strict code removed HTMLParseError removed HTMLParser.error and calls to HTMLParser.error removed
msg224551 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-02 11:10
New changeset 0e2e47c1f205 by Ezio Melotti in branch 'default': #15114: the strict mode and argument of HTMLParser, HTMLParser.error, and the HTMLParserError exception have been removed. http://hg.python.org/cpython/rev/0e2e47c1f205
msg224552 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-08-02 11:13
3.5 is done. Closing.
msg224575 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-02 15:54
New changeset 5b95f3fdcc0b by Ezio Melotti in branch 'default': #15114, #21047: update whatsnew in Python 3.5. http://hg.python.org/cpython/rev/5b95f3fdcc0b
History
Date User Action Args
2022-04-11 14:57:31 admin set github: 59319
2014-08-02 15:54:53 python-dev set messages: +
2014-08-02 11:13:18 ezio.melotti set status: open -> closedresolution: fixedmessages: + stage: needs patch -> resolved
2014-08-02 11:10:49 python-dev set messages: +
2014-07-05 10:41:41 berker.peksag set nosy: + berker.peksagversions: + Python 3.5, - Python 3.4
2014-02-14 05:29:14 ezio.melotti link issue20623 dependencies
2013-11-07 16:43:58 ezio.melotti set files: + issue15114-3.diffmessages: +
2013-11-02 15:08:38 python-dev set messages: +
2012-11-01 20:43:48 serhiy.storchaka set nosy: - serhiy.storchaka
2012-10-11 12:00:11 ezio.melotti set files: + issue15114-2.diffkeywords: + patch
2012-06-23 17:24:12 Arfrever set nosy: + Arfrever
2012-06-23 13:34:27 ezio.melotti set priority: release blocker -> normalversions: + Python 3.4, - Python 3.3messages: + keywords: - patchstage: commit review -> needs patch
2012-06-23 13:28:01 python-dev set nosy: + python-devmessages: +
2012-06-23 13:21:43 ezio.melotti set messages: +
2012-06-23 10:14:52 georg.brandl set messages: +
2012-06-22 18:27:25 ezio.melotti set stage: needs patch -> commit review
2012-06-21 14:50:15 ezio.melotti set files: + issue15114.diffkeywords: + patchmessages: +
2012-06-20 12:38:44 r.david.murray set messages: +
2012-06-20 10:01:34 serhiy.storchaka set nosy: + serhiy.storchaka
2012-06-20 09:42:50 ezio.melotti create