title: Python ftp.nlst() return empty list when where are (sub)directories on the server
body: <p>My application needs to download all the directories from a remote FTP, I'm testing for the first time the Python's <code>ftplib</code>.</p>
  <p>When I try to list all the directories in the remote FTP with the command <code>ftp.nlst()</code> it return an empty list. I know for sure that the directory is not empty because this command: <code>ftp.retrlines('list')</code> returned an object displaying the names of the subfolders inside the directory.</p>
  <p>While I was testing I tried other commands like <code>ftp.cwd('/other-dir/')</code> or <code>ftp.pwd()</code>, but none of these seems to work.</p>
  <p>This is the code that I'm using to display the list of subdirectories:</p>
  <pre><code>from ftplib import FTP
  
  def ftpConnection():
      ftp = FTP('ftp-address')
      ftp.login('user', 'password') 
      lista = ftp.nlst()
      return (lista)
  
  print(ftpConnection())
  </code></pre>
  <p>Output:</p>
  <pre><code>[]
  </code></pre>
  <p>As you can see the list is empty.</p>
  <hr />
  <p>This is my code for <code>retrlines</code>:</p>
  <pre><code>def ftpConnection():
      ftp = FTP('remoteFtp')
      ftp.login('user', 'password') 
      ftp.retrlines('LIST')
  
  print (ftpConnection())
  </code></pre>
  <p>Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>drw-rw-rwx 1          512 Jun 29 09:23 .
  drw-rw-rwx 1          512 Jun 28 05:11 103367
  drw-rw-rwx 1          512 Jun 29 02:01 121901
  drw-rw-rwx 1          512 Sep 23  2016 123233
  drw-rw-rwx 1          512 Jun 29 09:19 125183
  drw-rw-rwx 1          512 Jun 29 02:34 133028
  </code></pre>
  <hr />
  <p>This is the output from command-line <code>ftp</code>:</p>
  <pre class="lang-none prettyprint-override"><code>230-Welcome clt_kantar_italy from remoteFtp. You are now logged in to the server.
  230 User logged in, proceed.
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>ftp&gt; dir
  200 PORT command successful.
  150 File status okay; about to open data connection.
  drw-rw-rwx 1          512 Jun 29 09:23 .
  drw-rw-rwx 1         512 Jun 28 05:11 103367
  drw-rw-rwx 1          512 Jun 29 02:01 121901
  drw-rw-rwx 1          512 Sep 23  2016 123233
  drw-rw-rwx 1          512 Jun 29 09:19 125183
  drw-rw-rwx 1          512 Jun 29 02:34 133028
  226 Closing data connection. Transferred 481 bytes.
  ftp: 484 bytes received in 0.01secondi 37.23Kbyte/sec)
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>ftp&gt; ls
  200 PORT command successful.
  150 File status okay; about to open data connection.
  226 Closing data connection. Transferred 0 bytes.
  </code></pre>