Question

I apologize for not being able to specify the problem any further but that's because I don't understand what is going wrong here. The error is caused by line 75 but he has all the values of the variables I call. I'm obviously missing something here, I hope someone can tell me what.

What I am trying to do is adding a string to a variable, for every part of a list.

<type 'exceptions.MemoryError'> Python 2.6.4: /opt/users/ipg/s/p/ipg.*********/python/python
Sat May 10 19:42:39 2014
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

       73                                 """ % (description[field_count].value)
       74             for item in upload_field:
       75                 article_content += '<img src="http://www.*****.com/images/%s/%s">' % (link_title, item.filename)
       76             field_count = field_count + 1 
       77     elif isinstance(description, basestring):
___

    article_content undefined, link_title = 'sssfzxs', item = FieldStorage('upload_image1', '857143_7542303279...\x94\x01\xa3\x89\x82\xcc0\xc9n\xea/\x87\xff\xd9'), item.filename = '857143_754230327924155_1256712041_o.jpg'
    <type 'exceptions.MemoryError'>: 
          args = () 
          message = ''
Était-ce utile?

La solution

The MemoryError is being raised in an out of memory situations, as per the docs.

Is there any chance your code is looping there indefinitely?

Or you may actually be hitting the memory limit on a 32-bit version of Python just because of concatenating too much data, a similar situation as described here. In that case, you might be able to optimize the concatenation or use a 64-bit version of Python to get you through.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top