geobricks / geobricks_downloader

Core functionalities for geospatial data download.
GNU General Public License v2.0
3 stars 1 forks source link

beatifulsoap error #6

Closed stefanocudini closed 8 years ago

stefanocudini commented 8 years ago
/usr/local/lib/python2.7/dist-packages/bs4/__init__.py:166: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

To get rid of this warning, change this:

 BeautifulSoup([your markup])

to this:

 BeautifulSoup([your markup], "lxml")

  markup_type=markup_type))
Traceback (most recent call last):
  File "/home/z4k/www/nena-server/start.py", line 13, in <module>
    layers_to_be_downloaded = list_layers_countries_subset(product, year, day, country)
  File "/home/z4k/www/geobricks/geobricks/server/geobricks_modis/geobricks_modis/core/modis_core.py", line 345, in list_layers_countries_subset
    out += list_layers_countries_subset_gaul(product_name, year, day, country_code)
  File "/home/z4k/www/geobricks/geobricks/server/geobricks_modis/geobricks_modis/core/modis_core.py", line 380, in list_layers_countries_subset_gaul
    tmp = list_layers_subset(product_name, year, day, from_h, to_h, from_v, to_v)
  File "/home/z4k/www/geobricks/geobricks/server/geobricks_modis/geobricks_modis/core/modis_core.py", line 244, in list_layers_subset
    ftp.retrlines('MLSD', ls.append)
  File "/usr/lib/python2.7/ftplib.py", line 437, in retrlines
    conn = self.transfercmd(cmd)
  File "/usr/lib/python2.7/ftplib.py", line 376, in transfercmd
    return self.ntransfercmd(cmd, rest)[0]
  File "/usr/lib/python2.7/ftplib.py", line 339, in ntransfercmd
    resp = self.sendcmd(cmd)
  File "/usr/lib/python2.7/ftplib.py", line 249, in sendcmd
    return self.getresp()
  File "/usr/lib/python2.7/ftplib.py", line 224, in getresp
    raise error_perm, resp
ftplib.error_perm: 500 Unknown command.

Process finished with exit code 1
Kalimaha commented 8 years ago

The problem should lie in:

ftp.retrlines('MLSD', ls.append)

because it seems that MODIS's FTP does not support the MLSD mode anymore. To be investigated.

stefanocudini commented 8 years ago

useful for enhancement http://code.activestate.com/recipes/436211-ftpfindpy-a-command-line-tool-that-combines-the-fu/