Hi there,
I’m getting this f**king error while retrieving directory list using ftplib client, but can’t understand the reason …
I’m on VM Ubuntu 16, Python 2.7.12 and frappe on develop:
frappe@ubuntu16-dev:~$ python -V
Python 2.7.12
frappe@ubuntu16-dev:~$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> ftp = ftplib.FTP('ftp.sunet.se', 'anonymous', 'anonymous@sunet.se')
>>> ftp.dir()
-rw-r--r-- 1 ftp ftp 1204 Oct 04 15:11 HEADER.html
lrwxrwxrwx 1 ftp ftp 3 Mar 16 2010 Public -> pub
drwxr-xr-x 3 ftp ftp 10 Nov 07 19:50 about
drwxr-xr-x 28 ftp ftp 30 Nov 12 11:28 cdimage
drwxr-xr-x 2 ftp ftp 3 Jun 14 2006 conspiracy
lrwxrwxrwx 1 ftp ftp 22 Mar 16 2010 debian -> cdimage/.debian-mirror
drwxr-xr-x 5 ftp ftp 7 Mar 13 2016 debian-backports
lrwxrwxrwx 1 ftp ftp 16 Mar 16 2010 debian-cd -> cdimage/release/
-rw-r--r-- 1 ftp ftp 318 Mar 21 2005 favicon.ico
drwxr-xr-x 57 ftp ftp 64 Oct 25 09:29 mirror
drwxr-xr-x 4 ftp ftp 12 Feb 05 2016 pub
lrwxrwxrwx 1 ftp ftp 23 Mar 16 2010 releases -> mirror/ubuntu-releases/
-rw-r--r-- 1 ftp ftp 965 Oct 12 21:30 robots.txt
lrwxrwxrwx 1 ftp ftp 12 Aug 01 19:23 tails -> mirror/tails
lrwxrwxrwx 1 ftp ftp 13 Mar 16 2010 ubuntu -> mirror/ubuntu
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/ftplib.py", line 534, in dir
self.retrlines(cmd, func)
File "/usr/lib/python2.7/ftplib.py", line 440, in retrlines
line = fp.readline(self.maxline + 1)
File "/usr/lib/python2.7/socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
socket.error: [Errno 104] Connection reset by peer
On MacOS and python 2.7.12 it’s working fine:
MacBook-Pro $ python -V
Python 2.7.12
MacBook-Pro $ python
Python 2.7.12 (default, Sep 17 2016, 18:01:33)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> ftp = ftplib.FTP('ftp.sunet.se', 'anonymous', 'anonymous@sunet.se')
>>> fpt.dir()
-rw-r--r-- 1 ftp ftp 1204 Oct 04 15:11 HEADER.html
lrwxrwxrwx 1 ftp ftp 3 Mar 16 2010 Public -> pub
drwxr-xr-x 3 ftp ftp 10 Nov 07 19:50 about
drwxr-xr-x 28 ftp ftp 30 Nov 12 11:28 cdimage
drwxr-xr-x 2 ftp ftp 3 Jun 14 2006 conspiracy
lrwxrwxrwx 1 ftp ftp 22 Mar 16 2010 debian -> cdimage/.debian-mirror
drwxr-xr-x 5 ftp ftp 7 Mar 13 2016 debian-backports
lrwxrwxrwx 1 ftp ftp 16 Mar 16 2010 debian-cd -> cdimage/release/
-rw-r--r-- 1 ftp ftp 318 Mar 21 2005 favicon.ico
drwxr-xr-x 57 ftp ftp 64 Oct 25 09:29 mirror
drwxr-xr-x 4 ftp ftp 12 Feb 05 2016 pub
lrwxrwxrwx 1 ftp ftp 23 Mar 16 2010 releases -> mirror/ubuntu-releases/
-rw-r--r-- 1 ftp ftp 965 Oct 12 21:30 robots.txt
lrwxrwxrwx 1 ftp ftp 12 Aug 01 19:23 tails -> mirror/tails
lrwxrwxrwx 1 ftp ftp 13 Mar 16 2010 ubuntu -> mirror/ubuntu
>>>
As well as on VM Ubuntu 14, Python 2.7.6:
frappe@erpnext:~$ python -V
Python 2.7.6
frappe@erpnext:~$ python
Python 2.7.6 (default, Jun 22 2015, 18:00:18)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> ftp = ftplib.FTP('ftp.sunet.se', 'anonymous', 'anonymous@sunet.se')
>>> ftp.dir()
-rw-r--r-- 1 ftp ftp 1204 Oct 04 15:11 HEADER.html
lrwxrwxrwx 1 ftp ftp 3 Mar 16 2010 Public -> pub
drwxr-xr-x 3 ftp ftp 10 Nov 07 19:50 about
drwxr-xr-x 28 ftp ftp 30 Nov 12 11:28 cdimage
drwxr-xr-x 2 ftp ftp 3 Jun 14 2006 conspiracy
lrwxrwxrwx 1 ftp ftp 22 Mar 16 2010 debian -> cdimage/.debian-mirror
drwxr-xr-x 5 ftp ftp 7 Mar 13 2016 debian-backports
lrwxrwxrwx 1 ftp ftp 16 Mar 16 2010 debian-cd -> cdimage/release/
-rw-r--r-- 1 ftp ftp 318 Mar 21 2005 favicon.ico
drwxr-xr-x 57 ftp ftp 64 Oct 25 09:29 mirror
drwxr-xr-x 4 ftp ftp 12 Feb 05 2016 pub
lrwxrwxrwx 1 ftp ftp 23 Mar 16 2010 releases -> mirror/ubuntu-releases/
-rw-r--r-- 1 ftp ftp 965 Oct 12 21:30 robots.txt
lrwxrwxrwx 1 ftp ftp 12 Aug 01 19:23 tails -> mirror/tails
lrwxrwxrwx 1 ftp ftp 13 Mar 16 2010 ubuntu -> mirror/ubuntu
>>>
I’m not really sure if it’s some of the installed packages from bench that differ from Ubuntu 14 or whatever …can someone help on this?