OverflowError while sending large file via socket

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Apr 13 08:15:48 CEST 2009


En Sun, 12 Apr 2009 19:28:43 -0300, <//phr.cx at nospam.invalid>> escribió:
> Ryniek90 <ryniek90 at gmail.com> writes:

>> When i wanted to send an .iso file of 4GB length, i had traceback:
>> "OverflowError: requested number of bytes is more than a Python string
>> can hold"
>
> You're not supposed to put the 4GB all in one string.  Open the
> socket and send smaller packets through it.

And instead of reinventing the wheel again, use the shutil module to do  
exactly that.

-- 
Gabriel Genellina




More information about the Python-list mailing list