[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 that far.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27447>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 function, which is very confusing.

--
components: Library (Lib)
messages: 269781
nosy: towb
priority: normal
severity: normal
status: open
title: python -m doctest file_with_no_py_extension # silently fails
type: behavior
versions: Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27447>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)

However the declaration disappears if your don't pass an encoding. This doesn't 
match the documentation:

xml_declaration controls if an XML declaration should be added to the file. 
Use False for never, True for always, None for only if not US-ASCII or UTF-8 or 
Unicode (default is None).

--
components: Library (Lib)
messages: 229238
nosy: towb
priority: normal
severity: normal
status: open
title: ElementTree only writes declaration when passed encoding
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22622
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com