×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Unhappy Python CONE 8, sometimes System Error -50

    Hmph,

    I run script in emulator without any problems, I exit script without any problems, but when I exit python shell there's "Python CONE 8" error. The only script which I ran was my own, so there MUST be something wrong with it.

    There's no error notes after running the script. Trace doesn't show anything suspicious. Everything is juuuuuust fine - until I exit python shell.

    How to debug this kind of error?

    There was earlier also "system error (-50)", but it disappeared. That means "Exception in UI callback" and CONE 8 most likely means "Environment found window server resources had not been freed". That suggests that I created something related to appuifw and it wasn't ever deleted or released.

    What kind of cleanup I have to do myself? This sample is basically what I did, should I somehow delete myText? Should I delete m object? There are no tabs, no views, no icons, no listbox, no canvas - nothing but one appuifw.Text() and few writings on it.

    This sample gives same CONE 8 error, here's how to use:

    1) Start python shell
    2) Run this script
    3) Exit script
    4) Exit pythin shell

    Btw using S60 3rd Edition SDK MR with Python 1.4.2.

    Code:
    import e32
    import appuifw
    import graphics
    import key_codes
    
    class Main(object):
    
      def __init__(self):
        appuifw.app.screen = 'normal'
        appuifw.app.title = u'Test'
        appuifw.app.exit_key_handler = self.cb_quit
        appuifw.app.menu = [
    	(u"Exit",self.cb_quit)]
    
        self.myText = appuifw.Text()
        self.myText.font = u"title"
        self.myText.style = (appuifw.STYLE_BOLD | appuifw.STYLE_UNDERLINE)
        self.myText.add(u'Test\n\n')
        self.myText.font = u"normal"
        self.myText.style = 0
        self.print_status(u"Press Select key to start:")
        appuifw.app.body = self.myText
    
        self.myText.bind(key_codes.EKeyEnter, lambda: self.sample())
        self.myText.bind(key_codes.EKeySelect, lambda: self.sample())
    
      def print_status(self, aString):
        self.myText.add(unicode(aString))
        self.myText.add(u'\n')
        e32.ao_sleep(0.1)  # Give time to update screen
    
      def sample(self):
        pass
    
      def cb_quit(self):
        app_lock.signal()
    
    m = Main()
    app_lock = e32.Ao_lock()
    app_lock.wait()

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Python CONE 8, sometimes System Error -50

    Quote Originally Posted by JOM View Post
    How to debug this kind of error?
    The oldest debug method is still working: describe the problem to anyone who doesn't know anything about it

    The solution was:
    Code:
      def cb_quit(self):
        self.myText.bind(key_codes.EKeyEnter, None)
        self.myText.bind(key_codes.EKeySelect, None)
        app_lock.signal()
    Maybe I have to start doing that always, even with canvas.bind(key_codes.EKeySomething, lambda: do_something(NOW)). Have to confess I had no idea this has to be done...

    Sorry for trouble,

    --jouni

Similar Threads

  1. Please help installing Python libraries on S60
    By ericroijen in forum Symbian
    Replies: 11
    Last Post: 2009-07-18, 10:43
  2. Replies: 2
    Last Post: 2007-09-13, 19:32
  3. Replies: 2
    Last Post: 2007-06-19, 18:31
  4. what does python system error -50 mean?
    By romotrp in forum Bluetooth Technology
    Replies: 1
    Last Post: 2007-04-30, 15:42
  5. System Help with nokia pc connectivity SDK
    By gotka in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2004-07-06, 09:56

Posting Permissions

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