[Python-Dev] Are undocumented exceptions considered bugs?
stefan.bucur at gmail.com
Sat Mar 23 12:05:13 CET 2013
I'm not sure this is the right place to ask this question, but I thought
I'd give it a shot since it also concerns the Python standard library.
I'm writing an automated test case generation tool for Python programs that
explores all possible execution paths through a program. When applying this
tool on Python's 2.7.3 urllib package, it discovered input strings for
which the urllib.urlopen(url) call would raise a TypeError. For instance:
File "/home/bucur/onion/python-bin/lib/python2.7/urllib.py", line 86, in
File "/home/bucur/onion/python-bin/lib/python2.7/urllib.py", line 207, in
return getattr(self, name)(url)
File "/home/bucur/onion/python-bin/lib/python2.7/urllib.py", line 462, in
File "/home/bucur/onion/python-bin/lib/python2.7/urllib.py", line 474, in
stats = os.stat(localname)
TypeError: must be encoded string without NULL bytes, not str
In the urllib documentation it is only mentioned that the IOError is raised
when the connection cannot be established. Since the input passed is a
string (and not some other type), is the TypeError considered a bug (either
in the documentation, or in the implementation)?
Thanks a lot,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev