10 Feb
2013
10 Feb
'13
2:48 a.m.
On 9 February 2013 20:08, R. David Murray
Especially given that there is already a try/except there, this seems fine to me. I think perhaps the error text would be better if it referred only to the type that is invalid, not to str. So something like:
TypeError("object of type {} is not valid as a path "component".format(type(bad)))
--David
I agree that this is a better error message. I have raised an enhancement issue as Terry suggested: http://bugs.python.org/issue17174