Results 1 to 3 of 3

Thread: ValueError: invalid value for argument

  1. #1
    dmitry.medvedev's Avatar
    dmitry.medvedev is offline Registered User
    Name: Dmitry N. Medvedev
    Organization: Personal
    Project: Casual Game Analytics Dashboard
    Join Date
    Sep 2005
    Location
    Moscow, Russia
    Posts
    47

    Question ValueError: invalid value for argument

    Hi!

    Recently I have decided to start writing tests in Python instead of C++, though my services are written in C++.

    To cut it short: I do always get the "ValueError: invalid value for argument 1 in operation `AddUser'" exception when trying to run my test.

    The faulting ( slice definition ) function is:
    Code:
    int AddUser(User objUser, out long lUserId) ;
    The faulting python code is:
    Code:
    nError, lPlayerUserId = secrt.AddUser(objUser)
    I am suspecting myself in not clearly understanding how out parameters should be handled by python code.

    Please, could you look into the files attached and provide a hint on what I do wrong.

    ----
    With best regards,
    Dmitry
    Attached Files Attached Files
    Dmitry N. Medvedev@FaceBook

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi Dmitry,

    This line is the problem:

    Code:
    objUser = Secrt.User
    This does not allocate an instance of Secrt.User, but actually assigns a reference to the Secrt.User class. Here is how you should be allocating the instance:

    Code:
    objUser = Secrt.User()
    Regards,
    Mark

  3. #3
    dmitry.medvedev's Avatar
    dmitry.medvedev is offline Registered User
    Name: Dmitry N. Medvedev
    Organization: Personal
    Project: Casual Game Analytics Dashboard
    Join Date
    Sep 2005
    Location
    Moscow, Russia
    Posts
    47
    Quote Originally Posted by mes View Post
    Hi Dmitry,

    This line is the problem:

    Code:
    objUser = Secrt.User
    This does not allocate an instance of Secrt.User, but actually assigns a reference to the Secrt.User class. Here is how you should be allocating the instance:

    Code:
    objUser = Secrt.User()
    Regards,
    Mark
    Yes, sir! That was the problem. Dumb me
    Dmitry N. Medvedev@FaceBook

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Invalid proxy
    By sirkal in forum Help Center
    Replies: 4
    Last Post: 02-18-2011, 09:52 AM
  2. Invalid argument socket error on HP-UX
    By tctimmeh in forum Help Center
    Replies: 4
    Last Post: 08-22-2008, 12:58 PM
  3. socket exception: Invalid argument
    By xorax in forum Help Center
    Replies: 2
    Last Post: 10-24-2007, 04:54 AM
  4. Replies: 1
    Last Post: 12-14-2005, 04:09 PM
  5. Objects as argument ?
    By ChMeessen in forum Comments
    Replies: 2
    Last Post: 09-18-2003, 04:48 PM

Tags for this Thread

Posting Permissions

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