[docs] os.path.basename() bug

Frank Cusack fr4nk at mode.net
Thu Sep 20 19:35:09 EDT 2018


os.path.basename(*path*)¶
<https://docs.python.org/2/library/os.path.html#os.path.basename>

Return the base name of pathname *path*. This is the second element of the
pair returned by passing *path* to the function split()
<https://docs.python.org/2/library/os.path.html#os.path.split>. Note that
the result of this function is different from the Unix *basename* program;
where *basename* for '/foo/bar/' returns 'bar', the basename()
<https://docs.python.org/2/library/os.path.html#os.path.basename>function
returns an empty string ('').
Clearly 'second element' is wrong, even for the given example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20180920/11a64d02/attachment.html>


More information about the docs mailing list