msg163265 - (view) |
Author: Ezio Melotti (ezio.melotti) * |
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) * |
Date: 2012-06-20 12:38 |
Your plan sounds fine to me. |
|
|
msg163337 - (view) |
Author: Ezio Melotti (ezio.melotti) * |
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) * |
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) * |
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) |
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) * |
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) |
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) * |
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) |
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) * |
Date: 2014-08-02 11:13 |
3.5 is done. Closing. |
|
|
msg224575 - (view) |
Author: Roundup Robot (python-dev) |
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 |
|
|