Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2010

    Generic MemoryError

    Hi All,

    I have this code

            def send_media(self, servlet_call):
                    packet_data    = {
                            'upload_file' : open(my_sound_file,'rb').read().encode('base64'),
                            'id'         : str(self._id),
                            'time'    : str(self._time)
                            headers = {
                                    "Content-type": "application/x-www-form-urlencoded",
                                    "Accept": "text/plain"
                            ft_server = httplib.HTTPConnection( self._server_conn )
                                    '/' + servlet_call,
                            return True
                    except Exception, e:
                            return False
                    # end try
            #end def
    It does everything correctly but then when it gets to the point where i tries to urllib the file and encode the file it gives a memory error (MemoryError) with the message

    1251, in urlencode, newcore\Lib\urllib.py MemoryError

    I have no idea why this is happening, is there any suggestions as to how to get around this. I increased the heapsize to 5M and the file i want to upload is no bigger then about 1 meg. Still no luck.

    And just to add, when its running in the pythonshell (as i was testing it prior to making sis file) it runs perfectly fine without the MemoryError Error.

    Last edited by sidneib; 2010-03-09 at 20:54.

  2. #2
    Super Contributor
    Join Date
    May 2008
    Helsinki, Finland

    Re: Generic MemoryError

    Hi sidneib,

    Regarding it is a MemoryError, and based on this information I would not make any hasty conclusions yet. And I assume that is not all of your code visible?

    Please could you try providing traceback information?

    If you want, check this article:


    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330

Similar Threads

  1. Generic Button API
    By mit@indianic.com in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-03-07, 19:17
  2. MemoryError inserting rows in db
    By totetote in forum Symbian
    Replies: 3
    Last Post: 2008-06-11, 16:42
  3. Replies: 1
    Last Post: 2007-03-20, 18:06
  4. For Generic application, which platform/tech/tools to choose
    By contactabbas in forum Mobile Java General
    Replies: 2
    Last Post: 2006-11-06, 11:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts