~sschwarzer/ftputil#113: 
isdir fails because of trailing forward slash

I believe there is a bug in lines 134 and 155 of path.py. The lines I'm talking about are of the form

if path == self._host.getcwd():

the error is that (at least) in some cases _host.getcwd() returns the path with a trailing forward slash while path may not have a trailing slash, that makes the comparison

u'/somepath' == u'/somepath/'

fail when it shouldn't.

I think paths should be normalized before comparing.

Status
RESOLVED FIXED
Submitter
ftputiluser (unverified)
Assigned to
No-one
Submitted
7 years ago
Updated
7 years ago
Labels
bug library

ftputiluser (unverified) 7 years ago · edit

"Apparently the error only appeared as a consequence of the LIST -a command failing. When I set the use_list_a_option to False it does not manifest."

I rushed into this. Sorry, the error is still there even with use_list_a_option set to False

schwa (unverified) 7 years ago · edit

Thanks a lot for your report! :-)

Although not strictly necessary, it would be great if you had a working code example that shows the bug.

schwa (unverified) 7 years ago · edit

Register here or Log in to comment, or comment via email.