[issue27447] python -m doctest script_file_with_no_py_extension produces confusing NameErrors

2016-07-04 Thread towb
towb added the comment: Improving the documentation would also be nice, and easier. -m is mentioned in two places, first only as a shortcut for testmod, later with an explanation on name extensions and testfile. At least I didn't get tha

[issue27447] python -m doctest file_with_no_py_extension # silently fails

2016-07-04 Thread towb
New submission from towb: Command line tools usually use the shebang and don't have a .py extension. This breaks the `python -m doctest` shortcut for testmod(). Getting it to work is probably ugly, but there should be a useful message. Currently it's just a NameError for every funct

[issue22622] ElementTree only writes declaration when passed encoding

2014-10-13 Thread towb
New submission from towb: This generates an XML declaration: import xml.etree.ElementTree as ET root = ET.Element('rss', version='2.0') tree = ET.ElementTree(root) tree.write('test.xml', encoding='iso-8859-1', xml_declaration=True) Ho