Forum Discussion

icenamor's avatar
icenamor
Occasional Contributor
6 years ago

TypeError: 'SafeArrayWrapper' object does not support item assignment

I have a problem with the following source code:

 

 

The code of accesRightEnttyDTO is a definitin

 

def AccessRightEntryDTO():
#Get the type factory for the web service
TypeFactory = WebServices.DmsWebService.TypeFactory
Result = TypeFactory.AccessRightEntryDTO
Result.accessRights = 'FULL_ACESS'
Result.subject = TypeFactory.AccessRightSubjectDTO
Result.subject.subjectId = 1000
Result.subject.subjectType = 'USER'
return Result;

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Rather than using CreateVariantArray, you can use the native Python list data type.  The VariantArray that is created is not the same as a regular array.

    • icenamor's avatar
      icenamor
      Occasional Contributor

      I replace for this code: 

       

          queue = []
          queue.append(LinkedModuleDTO())
          Result.linkedModules = queue

      And the  error is: 

      Python runtime error. RuntimeError: The parameter is incorrect. 
      RuntimeError: The parameter is incorrect.