[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2013-08-05 Thread Alex Henderson
Alex Henderson added the comment: Proposed patch copied over from duplicate issue 17372. -- keywords: +patch nosy: +alex.henderson Added file: http://bugs.python.org/file31168/issue14465.patch ___ Python tracker rep...@bugs.python.org http

[issue17840] base64_codec uses assert for runtime validity checks

2013-07-12 Thread Alex Henderson
Alex Henderson added the comment: OK, now raises ValueError on passing anything other than 'strict'. Note that for the incremental classes I've put checking in __init__ so that ValueError is raised when non-'strict' values are passed to the constructor, not when the incremental encode/decode

[issue17372] provide pretty printer for xml.etree.ElementTree

2013-07-07 Thread Alex Henderson
Alex Henderson added the comment: I have attached a proposed patch. This makes some design decisions which I would like someone to review: a) To incorporate pretty-printing into the main write() method rather than adding a separate toprettyxml() method. Disadvantages: greater complexity

[issue17840] base64_codec uses assert for runtime validity checks

2013-07-07 Thread Alex Henderson
Alex Henderson added the comment: Having discussed this with Ezio, I think the better option might be to raise ValueError instead - if someone is expecting to be able to silently recover from errors they won't be able to, and should find out about this sooner rather than later. I'll upload

[issue17372] provide pretty printer for xml.etree.ElementTree

2013-07-07 Thread Alex Henderson
Alex Henderson added the comment: One other design decision - currently it doesn't deal with the indentation of comments or processing instructions: it leaves them unindented. Should they be indented the same as other tags? -- ___ Python tracker

[issue17840] base64_codec uses assert for runtime validity checks

2013-07-06 Thread Alex Henderson
Alex Henderson added the comment: I see that there is identical usage of assert errors=='strict' in a number of similar encodings modules: base64_codec.py bz2_codec.py hex_codec.py quopri_codec.py uu_codec.py zlib_codec.py The error handling mode is irrelevant for all these codecs, so