[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-04 Thread Sworddragon
New submission from Sworddragon : If a client gets a reconnect and a new ip from the provider the methods of ftplib can't handle this and are hanging in an infinite loop. For example if a file is transfered with storbinary() and the client gets a new ip address the script will never end. I'm u

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It seems expected behavior to me, and the same issue should apply to all other network libs as well. What would you expect ftplib to do in such case? -- nosy: +giampaolo.rodola ___ Python tracker

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon added the comment: If the connection gets lost and reconnected again but the ip address doesn't change storbinary() continues the data transfer. But if the ip address was changed due to the reconnect storbinary() hangs in a loop. I expect either that storbinary() detects the chang

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: What storbinary does is just using a socket to send data. There's no way for storbinary to ask the socket whether an unpredicted event such as an IP change occurred and neither it should. As a user, you just shouldn't change the IP address while a network a

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon added the comment: The problem is that it is for example here in germany very common that the provider disconnects the client every 24 hours and gives him a new ip address if his router reconnects. This makes it very difficult to send big files with ftplib. For example for daily

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Since you say the connection hangs I think you can set a timeout: >>> ftp = ftplib.FTP(..., timeout=30) That is applied to both control and data connection (and hence storbinary). This way you should get a socket.timeout exception after 30 seconds. --

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon added the comment: If i set the timeout argument an exception s thrown if the ip address is changed. At least it's a workaround but we should think about if Python shouldn't try to detect changes of the ip address. It would be nicer to continue the file transfer like it does if th

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Python can't do that. It's a socket implementation detail. Python just exposes the underlying socket implementation as-is. I'm closing this out as rejected. -- assignee: -> giampaolo.rodola resolution: -> rejected status: open -> closed _