• Kazuhiko Shiozaki's avatar
    lazy_class: remove Broken from the base classes of ERP5BaseBroken. · ea892270
    Kazuhiko Shiozaki authored
    otherwise we will have an Exception in Python 3 while importing a Business Template,
    if a new portal type and its documents exist in the same Business Template.
    
    while importing a content file, like *.js...
    
    (BusinessTemplate.py)
      try:
        setattr(obj, property_name, data)
      except BrokenModified:
        obj.__Broken_state__[property_name] = data # <-- !!!
        obj._p_changed = 1
    
    obj.__Broken_state__ access here also raises BrokenModified.
    
    while importing an XML file...
    
    (ZODB/broken.py)
      def __new__(class_, *args):
        result = object.__new__(class_) # <-- !!!
        result.__dict__['__Broken_newargs__'] = args
        return result
    
    we get an exception 'TypeError: object.__new__(Portal Type) is not safe, use Base.__new__()'
    ea892270
lazy_class.py 15.1 KB