×

Discussion Board

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

    Generic MemoryError

    Hi All,

    I have this code

    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)
                    }
                    try:
                            headers = {
                                    "Content-type": "application/x-www-form-urlencoded",
                                    "Accept": "text/plain"
                            }
                            ft_server = httplib.HTTPConnection( self._server_conn )
                            ft_server.request(
                                    'POST',
                                    '/' + servlet_call,
                                    urllib.urlencode(packet_data),
                                    headers
                            )
                            return True
                    except Exception, e:
                            traceback.print_exc()
                            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.

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

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    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:

    http://wiki.forum.nokia.com/index.ph...0_applications


    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

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
  •  
×