Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#11 closed defect (fixed)

DIR() Does not work with directory and file names containing SPACEs (' ')

Reported by: Valeriy Pogrebitskiy (vpogrebi@… Owned by: schwa
Priority: minor Milestone: 2.2.2
Component: Library Version:
Keywords: ftputil, DIR, LS, NLST Cc:


All ftputil calls that call self._session.dir(<dirname>) fail when <dirname> contains space(s). This is attributable to the fact that dir() procedure is using DIR command on the server - which fails returning the list if path contains space(s).

Workaround is to replace use of DIR with the NLST call. NLST works fine with pathname containing space(s).

NOTICE: This behavior occured in one of the earlier releases of 'ftputil'. I am not sure if it still exists.

Change History (3)

comment:1 Changed 16 years ago by schwa

Keywords: ftputil added; FTPUTIL removed
Resolution: fixed
Status: newclosed

The issue you describe was probably fixed in r316. However, that fix only works if the directory you issue the call from is accessible (compare your ticket #10).

So it seems there is still a bug if the login directory isn't accessible and you access a path with spaces in it from the directory. I don't see an easy way to work around this problem combination (see FTPHost._dir in Regarding NLST, some servers don't seem to support it or in inconsistent ways across servers.

comment:2 Changed 15 years ago by schwa

As it turned out in a conversation with Johannes Strömberg, the above-mentioned fix covered only a part of the potential problems. I've checked in changesets 687:695 which should deal with mkdir, remove, rmtree and others, and also improve the support for the _dir method.

Note that the combination of directory names with spaces in them and an inaccessible login directory still doesn't work and probably can't be made to work either. Luckily, this situation should be a rare.

The fix will be in the next release (2.2.2 or 2.3).

comment:3 Changed 12 years ago by schwa

Milestone: 2.2.2
Note: See TracTickets for help on using tickets.