Menu

Insert error with pyxb 1.2.2

Help
dzerugral
2013-07-08
2013-07-08
  • dzerugral

    dzerugral - 2013-07-08

    I just upgraded to 1.2.2 and there seems to be a fundamental change in how elements get inserted (could this be a bug for 1.2.2?)

    self.__list.insert(i, map(self.__convert, x))
    TypeError: argument 2 to map() must support iteration

    that is the error I get anytime I try to insert an element into an array element that has "one or more" elements. This was never a problem with 1.1.4.

    I have example code attached (full working example in 1.4.4)

    Here is the code:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #!/usr/bin/python
    import order_schema
    
    
    # create a general setting (for any schema that needs a setting)
    #set = set_schema.Setting()
    set = order_schema.Setting()
    set.name = 'dummy'
    set.ordinal = 0
    set.value_.insert(0,'default')
    
    # it isn't a string but instead it is a list of characters (in 1.2.2)!
    print set.value_
    
    # create an order.
    order_root = order_schema.Order_Root()
    # It doesn't allow me to insert an element (but it did in 1.1.4)
    order_root.setting.insert(0,set)
    
     

    Last edit: dzerugral 2013-07-08
  • Peter A. Bigot

    Peter A. Bigot - 2013-07-08

    Please provide the pyxbgen command line you used to generate the bindings so I don't have to guess how to reproduce the problem. Thanks.

     
  • Peter A. Bigot

    Peter A. Bigot - 2013-07-08

    Added https://sourceforge.net/apps/trac/pyxb/ticket/201

    I'll get a patch out in a day or so when I have time to make sure the analysis is correct.

     
  • Peter A. Bigot

    Peter A. Bigot - 2013-07-08

    Fix queued for PyXB 1.2.3, and patch available at https://sourceforge.net/apps/trac/pyxb/ticket/201

     

Log in to post a comment.

MongoDB Logo MongoDB