×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    12

    SymbianError: [Errno -21] KErrAccessDenied

    Dear,

    I'm following the examples of the book: Mobile Python, Rapid Prototyping of Applications on the Mobile Platform

    On example 17 (page 69): SMS receiver happens the following error:

    Traceback (most recent call last):
    File "e:\data\python\example_17.py", line 4, in message_received
    appuifw.note(u"New message: %s" %box, content(msg_id))
    SymbianError: [Errno -21] KErrAccessDenied

    What does it means?

    What should I do?

    Thanks,
    Markos

    PS example_17.py

    import inbox, appuifw, e32
    def message_received(msg_id):
    box = inbox.Inbox()
    appuifw.note(u"New message: %s" % box.content(msg_id))
    app_lock.signal()
    box = inbox.Inbox()
    box.bind(message_received)
    print "Waiting for new SMS messages.."
    app_lock = e32.Ao_lock()
    app_lock.wait()
    print "Message handled!"

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: SymbianError: [Errno -21] KErrAccessDenied

    Working with messages requires ReadUserData capability. While it is a self-signed capability, it may be still missing from certain PyS60 releases for some reason.
    By the way: self signed code asks about the capabilities on installation, so if there was no such question when you installed Python, the capability is really missing.

  3. #3
    Registered User
    Join Date
    Dec 2012
    Posts
    12

    Re: SymbianError: [Errno -21] KErrAccessDenied

    Dear wizard_hu,

    I noticed that this is not a constant error.

    The program runs without error only the first time.

    Then I need to reboot the phone (Nokia E71) for the program to work again. Sometimes it does not work even after rebooting.

    It's strange because this behavior when I start writing the interpreter appears:
    Capabilities Present: ('NetworkServices', 'LocalServices', 'ReadUserData', 'WriteUserData', 'UserEnvironment')
    and the command e32.get_capabilities() returns the same.

    What do you suggest me to do?

    Thanks for your attention,
    Markos

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: SymbianError: [Errno -21] KErrAccessDenied

    Is it possible that you forgot to close the resources after the message has been received successfully & the next time when you try to use that resource then it doesn't allows you to do so as its already occupied(just a case).

  5. #5
    Registered User
    Join Date
    Dec 2012
    Posts
    12

    Re: SymbianError: [Errno -21] KErrAccessDenied

    Dear,

    I was thinking about your response and decided to test the use of a delay.

    I used the function time.sleep (1) before the function box.content (msg_id) and it worked!

    I think I could also use: e32.ao_sleep()

    Thanks for the tip.

    PS: I use Google, Altavista and DuckDuckgo. But what is Forum Wiki& DiBo?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: SymbianError: [Errno -21] KErrAccessDenied

    It may be a race condition then. Symbian receives a message in multiple steps, and whatever code invokes message_received may do that in an early stage.

Similar Threads

  1. SymbianError
    By sidneib in forum Symbian
    Replies: 1
    Last Post: 2010-03-08, 11:32
  2. SymbianError:[Errno -6]KErrArgument
    By fearoffours in forum Symbian
    Replies: 3
    Last Post: 2009-08-05, 12:57
  3. SymbianError -1, KErrNotFound
    By JOM in forum Symbian
    Replies: 2
    Last Post: 2009-04-19, 14:02
  4. SymbianError: Errno -46 KErrPermissionDenied
    By paul.haenel in forum Symbian
    Replies: 7
    Last Post: 2008-10-13, 10:59
  5. SymbianError: Errno -46 KErrPermissionDenied
    By paul.haenel in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 2
    Last Post: 2008-10-13, 09:46

Posting Permissions

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