Re: ftpilb.FTP.stor...() freeze mystery

2009-10-30 Thread Anthra Norell

Gabriel Genellina wrote:
En Thu, 29 Oct 2009 13:18:30 -0300, Anthra Norell 
anthra.nor...@bluewin.ch escribió:



Gabriel Genellina wrote:
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell 
anthra.nor...@bluewin.ch escribió:

Gabriel Genellina wrote:

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

I am trying to upload a bunch of web pages to a hosting 
service.[...]  I wrote a loop that iterates through the file 
names and calls either of the stor... () methods as appropriate. 
The loop successfully uploads eight of some twenty files and then 
freezes. Ctrl-C doesn't unlock the freeze. I have to kill the 
IDLE window


freezes are less predictable than it seemed in the beginning. On 
one occasion it occurred after the transfer of a single file from 
the IDLE command line (my_ftp_object.storlines (STOR file_name, 
f). The file did upload. So the freezes seem to occur after a 
successful transfer.


In this thread from last month, Sean DiZazzo shows how to add a 
timeout parameter to storbinary:

http://comments.gmane.org/gmane.comp.python.general/639258
Do the same with storlines and see whether it helps.

Thanks a million! Here's a way out by the look of it. As the devil is 
in the details I get an error that indicates an inconsistency in my 
ftplib library (2.4) (*** marks my comments):


Traceback (most recent call last):
 File pyshell#65, line 1, in -toplevel-
   d2jm = upload.run (1)
 File I:/DOK/projects/WEB/JM\upload.py, line 369, in run
   D2JM.copy_1_2 (do)
 File I:/DOK/projects/WEB/JM\upload.py, line 342, in copy_1_2
   try: self.FS2.storbinary ('STOR %s' % name, f, timeout = 
timeout)   *** Here's the call to the overwritten method with the 
timeout.

 File I:/DOK/projects/WEB/JM\upload.py, line 440, in storbinary
   self.connection = self.transfercmd (command)   *** command is 
'STOR (target file name)'. Control passes to ftplib

 File C:\PYTHON24\lib\ftplib.py, line 345, in transfercmd
   return self.ntransfercmd(cmd, rest)[0]
 File C:\PYTHON24\lib\ftplib.py, line 321, in ntransfercmd
   host, port = self.makepasv()
 File C:\PYTHON24\lib\ftplib.py, line 299, in makepasv
   host, port = parse227(self.sendcmd('PASV'))
 File C:\PYTHON24\lib\ftplib.py, line 566, in parse227
   raise error_reply, resp
error_reply: 200 TYPE is now 8-bit binary   *** 'is now' indicates 
something has changed resulting in an inconsistency


Is 'resp' supposed to be an int (227) rather than a string ('227')? 
Probably a wrong conclusion. In version 2.5 it is still a string. 
Anyway, I can't start editing the library trial-and-error style. So, 
I do thank you for the push. Mores pushes will be greatly 
appreciated, but I hesitate to invite travel companions for a stroll 
into this wilderness.


resp is a string, but not the response that PASV expected; apparently 
the server is sending some unexpected responses.  r52739 seems to fix 
that. Perhaps you should upgrade to a newer Python version.


http://svn.python.org/view?view=revrevision=52739



I know I should upgrade.That I shall do next. Not today, though. First I 
need a new computer, because my OS (Windows ME) is so outdated that 
installations fail with the recommendation to upgrade to a newer 
installer. Anyway, I do thank you very much for your assistance. With 
the r52739 fix I should be okay.


Regards

Frederic

--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-29 Thread Anthra Norell

Gabriel Genellina wrote:
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell 
anthra.nor...@bluewin.ch escribió:

Gabriel Genellina wrote:

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

I am trying to upload a bunch of web pages to a hosting 
service.[...]  I wrote a loop that iterates through the file names 
and calls either of the stor... () methods as appropriate. The loop 
successfully uploads eight of some twenty files and then freezes. 
Ctrl-C doesn't unlock the freeze. I have to kill the IDLE window


freezes are less predictable than it seemed in the beginning. On one 
occasion it occurred after the transfer of a single file from the 
IDLE command line (my_ftp_object.storlines (STOR file_name, f). The 
file did upload. So the freezes seem to occur after a successful 
transfer.


In this thread from last month, Sean DiZazzo shows how to add a 
timeout parameter to storbinary:

http://comments.gmane.org/gmane.comp.python.general/639258
Do the same with storlines and see whether it helps.

Thanks a million! Here's a way out by the look of it. As the devil is in 
the details I get an error that indicates an inconsistency in my ftplib 
library (2.4) (*** marks my comments):


Traceback (most recent call last):
File pyshell#65, line 1, in -toplevel-
  d2jm = upload.run (1)
File I:/DOK/projects/WEB/JM\upload.py, line 369, in run
  D2JM.copy_1_2 (do)
File I:/DOK/projects/WEB/JM\upload.py, line 342, in copy_1_2
  try: self.FS2.storbinary ('STOR %s' % name, f, timeout = timeout)   
*** Here's the call to the overwritten method with the timeout.

File I:/DOK/projects/WEB/JM\upload.py, line 440, in storbinary
  self.connection = self.transfercmd (command)   *** command is 'STOR 
(target file name)'. Control passes to ftplib

File C:\PYTHON24\lib\ftplib.py, line 345, in transfercmd
  return self.ntransfercmd(cmd, rest)[0]
File C:\PYTHON24\lib\ftplib.py, line 321, in ntransfercmd
  host, port = self.makepasv()
File C:\PYTHON24\lib\ftplib.py, line 299, in makepasv
  host, port = parse227(self.sendcmd('PASV'))
File C:\PYTHON24\lib\ftplib.py, line 566, in parse227
  raise error_reply, resp
error_reply: 200 TYPE is now 8-bit binary   *** 'is now' indicates 
something has changed resulting in an inconsistency



Line 566 in PYTHON24/lib/ftplib.py:

def parse227(resp):
  '''Parse the '227' response for a PASV request.
  Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
  Return ('host.addr.as.numbers', port#) tuple.'''
  if resp[:3] != '227':
  raise error_reply, resp *** Line 566
  global _227_re

Is 'resp' supposed to be an int (227) rather than a string ('227')? 
Probably a wrong conclusion. In version 2.5 it is still a string. 
Anyway, I can't start editing the library trial-and-error style. So, I 
do thank you for the push. Mores pushes will be greatly appreciated, but 
I hesitate to invite travel companions for a stroll into this wilderness.


Frederic

--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-29 Thread Gabriel Genellina
En Thu, 29 Oct 2009 13:18:30 -0300, Anthra Norell  
anthra.nor...@bluewin.ch escribió:



Gabriel Genellina wrote:
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell  
anthra.nor...@bluewin.ch escribió:

Gabriel Genellina wrote:

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

I am trying to upload a bunch of web pages to a hosting  
service.[...]  I wrote a loop that iterates through the file names  
and calls either of the stor... () methods as appropriate. The loop  
successfully uploads eight of some twenty files and then freezes.  
Ctrl-C doesn't unlock the freeze. I have to kill the IDLE window


freezes are less predictable than it seemed in the beginning. On one  
occasion it occurred after the transfer of a single file from the IDLE  
command line (my_ftp_object.storlines (STOR file_name, f). The file  
did upload. So the freezes seem to occur after a successful transfer.


In this thread from last month, Sean DiZazzo shows how to add a timeout  
parameter to storbinary:

http://comments.gmane.org/gmane.comp.python.general/639258
Do the same with storlines and see whether it helps.

Thanks a million! Here's a way out by the look of it. As the devil is in  
the details I get an error that indicates an inconsistency in my ftplib  
library (2.4) (*** marks my comments):


Traceback (most recent call last):
 File pyshell#65, line 1, in -toplevel-
   d2jm = upload.run (1)
 File I:/DOK/projects/WEB/JM\upload.py, line 369, in run
   D2JM.copy_1_2 (do)
 File I:/DOK/projects/WEB/JM\upload.py, line 342, in copy_1_2
   try: self.FS2.storbinary ('STOR %s' % name, f, timeout = timeout)
*** Here's the call to the overwritten method with the timeout.

 File I:/DOK/projects/WEB/JM\upload.py, line 440, in storbinary
   self.connection = self.transfercmd (command)   *** command is 'STOR  
(target file name)'. Control passes to ftplib

 File C:\PYTHON24\lib\ftplib.py, line 345, in transfercmd
   return self.ntransfercmd(cmd, rest)[0]
 File C:\PYTHON24\lib\ftplib.py, line 321, in ntransfercmd
   host, port = self.makepasv()
 File C:\PYTHON24\lib\ftplib.py, line 299, in makepasv
   host, port = parse227(self.sendcmd('PASV'))
 File C:\PYTHON24\lib\ftplib.py, line 566, in parse227
   raise error_reply, resp
error_reply: 200 TYPE is now 8-bit binary   *** 'is now' indicates  
something has changed resulting in an inconsistency


Is 'resp' supposed to be an int (227) rather than a string ('227')?  
Probably a wrong conclusion. In version 2.5 it is still a string.  
Anyway, I can't start editing the library trial-and-error style. So, I  
do thank you for the push. Mores pushes will be greatly appreciated, but  
I hesitate to invite travel companions for a stroll into this wilderness.


resp is a string, but not the response that PASV expected; apparently the  
server is sending some unexpected responses.  r52739 seems to fix that.  
Perhaps you should upgrade to a newer Python version.


http://svn.python.org/view?view=revrevision=52739

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-28 Thread Anthra Norell

Gabriel Genellina wrote:

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

  I am trying to upload a bunch of web pages to a hosting service. I 
have a connected ftplib.FTP object and can upload files manually from 
an IDLE command line using the methods storlines () for html files 
and storbinary () for the pictures. So far no problem. In order to 
upload the whole set of files I wrote a loop that iterates through 
the file names and calls either of the stor... () methods as 
appropriate. The loop successfully uploads eight of some twenty files 
and then freezes. Ctrl-C doesn't unlock the freeze. I have to kill 
the IDLE window which raises a confirmation request are you sure? 
The program is still running. Having no alternative I am sure. I 
open a new IDLE window and start over. Every retry fails the exact 
same way.


  From the description alone I can't infer any problem. Certainly 
uploading

files with ftplib worked fine last time I tried. Try to remove all
unnecesary lines from your script, making it as small as possible but
still showing your problem, and post it here.


Gabriel,
  Thank you for your suggestion. In the meantime I uploaded my entire 
webseite hacker style, listing the server directories after each 
freeze-restart and shortening the list of files to transfer by the ones 
that passed before the last freeze. The exercise revealed that the 
freezes are less predictable than it seemed in the beginning. On one 
occasion it occurred after the transfer of a single file from the IDLE 
command line (my_ftp_object.storlines (STOR file_name, f). The file 
did upload. So the freezes seem to occur after a successful transfer. 
The command-line freeze is evidence of an ftp protocol implementation or 
timing problem between the ftplib module and the hosting server. My code 
that passes files to the FTP object for transmission one by one is off 
the hook, so I won't bother you with it. Of course, I am in contact with 
the hosting service, but expect them not to assume the burden of proof. 
If you (or someone else) would suggest a means to visualize the 
transfer, dumping a stack or writing a log or something of that sort, I 
think I'd be on the right track.


Frederic



--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-28 Thread Gabriel Genellina
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell  
anthra.nor...@bluewin.ch escribió:

Gabriel Genellina wrote:

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

I am trying to upload a bunch of web pages to a hosting service.[...]   
I wrote a loop that iterates through the file names and calls either  
of the stor... () methods as appropriate. The loop successfully  
uploads eight of some twenty files and then freezes. Ctrl-C doesn't  
unlock the freeze. I have to kill the IDLE window


freezes are less predictable than it seemed in the beginning. On one  
occasion it occurred after the transfer of a single file from the IDLE  
command line (my_ftp_object.storlines (STOR file_name, f). The file  
did upload. So the freezes seem to occur after a successful transfer.


In this thread from last month, Sean DiZazzo shows how to add a timeout  
parameter to storbinary:

http://comments.gmane.org/gmane.comp.python.general/639258
Do the same with storlines and see whether it helps.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Gabriel Genellina

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

  I am trying to upload a bunch of web pages to a hosting service. I  
have a connected ftplib.FTP object and can upload files manually from an  
IDLE command line using the methods storlines () for html files and  
storbinary () for the pictures. So far no problem. In order to upload  
the whole set of files I wrote a loop that iterates through the file  
names and calls either of the stor... () methods as appropriate. The  
loop successfully uploads eight of some twenty files and then freezes.  
Ctrl-C doesn't unlock the freeze. I have to kill the IDLE window which  
raises a confirmation request are you sure? The program is still  
running. Having no alternative I am sure. I open a new IDLE window and  
start over. Every retry fails the exact same way.


  From the description alone I can't infer any problem. Certainly uploading
files with ftplib worked fine last time I tried. Try to remove all
unnecesary lines from your script, making it as small as possible but
still showing your problem, and post it here.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Gabriel Genellina

En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
anthra.nor...@bluewin.ch escribió:

  I am trying to upload a bunch of web pages to a hosting service. I  
have a connected ftplib.FTP object and can upload files manually from an  
IDLE command line using the methods storlines () for html files and  
storbinary () for the pictures. So far no problem. In order to upload  
the whole set of files I wrote a loop that iterates through the file  
names and calls either of the stor... () methods as appropriate. The  
loop successfully uploads eight of some twenty files and then freezes.  
Ctrl-C doesn't unlock the freeze. I have to kill the IDLE window which  
raises a confirmation request are you sure? The program is still  
running. Having no alternative I am sure. I open a new IDLE window and  
start over. Every retry fails the exact same way.


From the description alone I can't infer any problem. Certainly
uploading
files with ftplib worked fine last time I tried. Try to remove all
unnecesary lines from your script, making it as small as possible but
still showing your problem, and post it here.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Anthra Norell

Hi,
 I am trying to upload a bunch of web pages to a hosting service. I 
have a connected ftplib.FTP object and can upload files manually from an 
IDLE command line using the methods storlines () for html files and 
storbinary () for the pictures. So far no problem. In order to upload 
the whole set of files I wrote a loop that iterates through the file 
names and calls either of the stor... () methods as appropriate. The 
loop successfully uploads eight of some twenty files and then freezes. 
Ctrl-C doesn't unlock the freeze. I have to kill the IDLE window which 
raises a confirmation request are you sure? The program is still 
running. Having no alternative I am sure. I open a new IDLE window and 
start over. Every retry fails the exact same way.
  My upload method with the loop has a preview mode. It goes through 
all the motions including opening and closing my source files but skips 
the stor... () methods and in addition displays all commands. The 
preview mode completes the iteration sequence and shows nothing unexpected.
  What could be the problem? I am totally 
fazed and will be most grateful for expert suggestions.


Frederic

--
http://mail.python.org/mailman/listinfo/python-list