why this error?

F. Petitjean littlejohn.75 at news.free.fr
Wed Mar 16 00:12:19 CET 2005


Le Wed, 16 Mar 2005 17:53:57 -0500, spencer a écrit :
> Hi,
> I'm not sure why I can't concatenate dirname() with basename().
> 
> Traceback (most recent call last):
>   File "showDir.py", line 50, in ?
>     print 'somthing new...', os.path.join(os.path.dirname(os.getcwd)) +
> os.path.basename(os.getcwd())
The problem is here : os.path.join() take at least one parameter, but it
is silly to use it with only one.  Replace the « + » by a comma.
>   File "/usr/lib/python2.3/posixpath.py", line 119, in dirname
>     return split(p)[0]
>   File "/usr/lib/python2.3/posixpath.py", line 77, in split
>     i = p.rfind('/') + 1
> AttributeError: 'builtin_function_or_method' object has no attribute
> 'rfind'
> Thanks,
> Wayne
> 
> 



More information about the Python-list mailing list