Ticket #172 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

the inheritance tree is not consulted when encoding attributes

Reported by: nick Owned by: nick
Priority: major Milestone: 0.1
Component: Encoder Version: 0.1
Keywords: Cc:

Description

Consider the following:

import pyamf

class Person(object):
    pass

class User(Person):
    pass

pyamf.register_class(Person, 'spam.eggs.Person', attrs=['family_name', 'given_name'])
pyamf.register_class(User, 'spam.eggs.User', attrs=['username', 'password'])

u = User()
u.family_name = 'Doe'
u.given_name = 'Jane'
u.username = 'j.doe'
u.password = 'secret'

stream = pyamf.encode(u)

y = pyamf.decode(stream)

print y.next().family_name

Now this should spit out Doe but it currently raises an AttributeError? as the Person class is not checked to see if a register_class entry has been created for it.

Change History

Changed 10 months ago by nick

  • status changed from new to accepted
  • milestone set to Release Candidate 1

Changed 10 months ago by nick

Changed 10 months ago by nick

  • status changed from accepted to closed
  • resolution set to fixed

Fixed in r903

Note: See TracTickets for help on using tickets.