unpickle from URL problem

Alan Isaac aisaac at american.edu
Wed Oct 10 12:54:45 EDT 2007


Hrvoje Niksic wrote:
> The first upload breaks the file.  You uploaded it in (presumably
> FTP's) text mode, which changes \n -> \r\n.  But you download it using
> http, which specifies no such conversion in the opposite direction.

No: I used binary upload both time.
(Unless my ftp client is broken, and I think not.)

The first example simply keeps the Windows eols,
which are present in the pickled file on my Windows machine.
This is the one created by pickle.dump.
This file unpickles just fine.

I altered the 2nd file before upload,
changing to the Unix eol convention.
This also unpickles just fine on my machine,
but in addition the urllib download of this
file unpickles just fine.
 
Alan Isaac



More information about the Python-list mailing list