This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: out of memory in distutils.upload with large files
Type: resource usage Stage: resolved
Components: Distutils Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Jan.Stürtz, dstufft, eric.araujo, steve.dower
Priority: normal Keywords:

Created on 2015-07-23 09:44 by Jan.Stürtz, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg247179 - (view) Author: Jan Stürtz (Jan.Stürtz) Date: 2015-07-23 09:44
We tried to upload a very large (350MB) bdist egg via distutils to our internal package server. 
And received following crash.

Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    import os
  File "C:\devel\cdb\10.1.tag\cdb\python\cdb\comparch\pkgtools.py", line 120, in setup
    def setup(**kwargs):
  File "C:\devel\cdb\10.1.tag\win32\debug\img\lib\distutils\core.py", line 60, in setup
    def setup(**attrs):
  File "C:\devel\cdb\10.1.tag\win32\debug\img\lib\distutils\dist.py", line 947, in run_commands
    def run_commands(self):
  File "C:\devel\cdb\10.1.tag\win32\debug\img\lib\distutils\dist.py", line 957, in run_command
    def run_command(self, command):
  File "C:\devel\cdb\10.1.tag\win32\debug\img\lib\distutils\command\upload.py", line 56, in run
    def run(self):
  File "C:\devel\cdb\10.1.tag\win32\debug\img\lib\distutils\command\upload.py", line 154, in upload_file
    body.write('\r\nContent-Disposition: form-data; name="%s"' % key)
MemoryError: out of memory

A patch could be very easy using tempfile.SpooledTemporaryFile()
msg386340 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:19
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68879
2021-02-03 18:19:29steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386340

resolution: out of date
stage: resolved
2018-07-11 07:41:05serhiy.storchakasettype: crash -> resource usage
2015-07-23 09:44:12Jan.Stürtzcreate