Serhiy Storchaka added the comment:
Fixed in issue22034. See also issue21883.
--
nosy: +serhiy.storchaka
resolution: - out of date
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17174
New submission from Thomas Scrace:
Currently os.path.join will raise an AttributeError if passed an argument that
does not have an endswith() method.
A try/except around the offending line would let us raise a more helpful
TypeError:
except AttributeError as e:
bad =
Janzert added the comment:
While the current error message is a bit generic, I rather like that it tells
you exactly why the type/object passed couldn't be used.
--
nosy: +Janzert
___
Python tracker rep...@bugs.python.org
Eric V. Smith added the comment:
I think this change should not be made: it's a slippery slope, because there
are thousands of places in the stdlib where a similar change could be made.
It's the nature of duck typing that you're not going to get a great error
message everywhere you pass in