I am using python in Windows with ftplib to access a folder at ftp5.xyz.eu.
The folder is 'baz' in ftp5.xyz.eu in the folder 'foo bar'. So : ftp5.xyz.eu/foo bar/baz
I connect successfully at ftp5.xyz.eu but when i write the whole path to the folder it gives me an error:
from ftplib import FTP
#domain name or server ip:
ftp = FTP('ftp5.xyz.eu/foo%20bar')
...
ftp.dir()
error gived below:
File "C:\Users\mirel.voicu\AppData\Local\Programs\Python\Python37\lib\ftplib.py", line 117, in __init__
self.connect(host)
File "C:\Users\mirel.voicu\AppData\Local\Programs\Python\Python37\lib\ftplib.py", line 152, in connect
source_address=self.source_address)
File "C:\Users\mirel.voicu\AppData\Local\Programs\Python\Python37\lib\socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\mirel.voicu\AppData\Local\Programs\Python\Python37\lib\socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed