문제

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 = ''
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top