[ python-Bugs-1032875 ] ftplib has incomplete transfer when sending files in Windows

SourceForge.net noreply at sourceforge.net
Tue Oct 5 16:19:33 CEST 2004


Bugs item #1032875, was opened at 2004-09-22 21:21
Message generated for change (Comment added) made by grubert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1032875&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Ed Sanville (infinity314)
Assigned to: Nobody/Anonymous (nobody)
Summary: ftplib has incomplete transfer when sending files in Windows

Initial Comment:
I wrote the following short script:

from ftplib import FTP

ftp=FTP('ftp.edsanville.us', username, password)
print ftp.getwelcome()
print ftp.storbinary('stor test.xls', file('test.xls',
'r'))

ftp.quit()

It transfers the entire file under Red Hat Linux 9, but
under Windows XP, it only transfers a couple kilobytes
at most.  Using a hex editor, I found that the first 5
or 6 bytes of the file are OK on the remote side after
transfer, but the rest of the file is totally wrong. 
I'm at a loss, it doesn't make any sense.  Please,
somebody tell me I'm not insane.


----------------------------------------------------------------------

Comment By: engelbert gruber (grubert)
Date: 2004-10-05 16:19

Message:
Logged In: YES 
user_id=147070

looks like a file problem: f=open('test.xls');d=f.read() reads all the file.
on winxp/py234 not

making a binary file: for i in range(0,50):for d in range(0,255): f.write(d)

reading it: d=f.read() 
1.round len(d) = 26, f.tell() 12288
2.round len(d) = 26, f.tell() 12800

chr(26) is the end of a dos textfile.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1032875&group_id=5470


More information about the Python-bugs-list mailing list