Custom Query (120 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (22 - 24 of 120)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Ticket Resolution Summary Owner Reporter
#110 fixed Directory listings are empty if a server doesn't support the`-a` option schwa schwa
Description

This issue comes up from time to time (for example http://lists.sschwarzer.net/pipermail/ftputil/2017q2/thread.html).

Since ftputil 2.8 the library by default tries to list hidden files (i. e. files starting with a dot) by using the -a option. (Everything in this ticket also applies to hidden directories.)

There are three cases:

  • The server supports the -a option and is configured to list hidden files. This is what we ideally want.
  • The server supports the -a option but is configured to not list hidden files. In this case, the directory listing misses hidden files, which is what the server intended.
  • The server does not support the -a option. In this case, the server understands -a as a file name.

This third case usually means that the returned listing won't have any entries. After all, ftputil told the server (from its perspective) to list the file -a and the file isn't there. This behavior is most obvious in FTPHost.listdir, but probably effects other functionality as well.

#109 fixed LICENSE missing from sdist schwa ftputiluser
Description

The pypi sdist is missing the LICENSE file... this can likely be fixed in the MANIFEST.in

Reported-by: Philippe Ombredanne <pombredanne@…>

#108 duplicate Broken symlinks generate needless lstat calls schwa ftputiluser
Description

Hi,

I'm trying to walk() a directory on an FTP site that contains a large amount of broken symlinks to files in a different directory. The site in question is:

ftp://anonymous:anonymous@ftp.ebi.ac.uk/pub/databases/embl/new/

When walk('/pub/databases/embl/new/') runs, it sees a symlink to e.g. '../tsa/tsa_gfcx01_inv.dat.gz', and tries to follow it (even though followlinks is False). This starts an lstat of '/pub/databases/embl/tsa/' and the result of the directory listing is cached. If finds the file is missing and discards it.

However, when walk() hits the next broken symlink, it finds there's a cache miss for the file and does a new lstat of '/pub/databases/embl/tsa/' even though we just did it some milliseconds ago. This is then repeated for the hundreds of broken symlinks.

I have found two possible solutions:

1) Use the cache to detect that the directory has already been visited, and interpret a cache miss on the file as a broken link.

2) Change the semantics of walk(dir, followlinks=False) to not just discard directory symlinks, but also file symlinks. This is a small change in 'host.py':

--- host.py.orig	2017-01-27 16:20:04.633080980 +0100
+++ host.py	2017-01-27 16:20:22.027566063 +0100
@@ -905,7 +905,10 @@
             return
         dirs, nondirs = [], []
         for name in names:
-            if self.path.isdir(self.path.join(top, name)):
+            path = self.path.join(top, name)
+            if self.path.islink(path) and not followlinks:
+                continue
+            if self.path.isdir(path):
                 dirs.append(name)
             else:
                 nondirs.append(name)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Note: See TracQuery for help on using queries.