[Python-Dev] os.path.join failure mode

Thomas Scrace tom at scrace.org
Sat Feb 9 22:18:15 CET 2013


On 9 February 2013 20:08, R. David Murray <rdmurray at bitdance.com> wrote:
>
>
> 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


More information about the Python-Dev mailing list