Opened 5 years ago

Closed 5 years ago

#4430 defect closed fixed (fixed)

twisted.spread.jelly.unjelly breaks on classes defining __slots__

Reported by: toidinamai Owned by:
Priority: normal Milestone:
Component: pb Keywords: pb jelly __slots__
Cc: Branch: branches/jelly-slots-4430
(diff, github, buildbot, log)
Author: toidinamai Launchpad Bug:

Description (last modified by exarkun)

twisted.spread.jelly.unjelly breaks on classes that
do not have a __dict__ attribute and define their
own __setstate__ and __getstate__ methods for serialization.
An example of those classes are those defining __slots__.

Attachments (2)

slots-test.patch (1.1 KB) - added by toidinamai 5 years ago.
new test case
slots-solution.patch (1.4 KB) - added by toidinamai 5 years ago.
implementation for the new test case

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by toidinamai

new test case

Changed 5 years ago by toidinamai

implementation for the new test case

comment:1 Changed 5 years ago by toidinamai

  • Keywords review added
  • Owner warner deleted

comment:2 Changed 5 years ago by exarkun

  • Description modified (diff)

comment:3 Changed 5 years ago by exarkun

  • Author set to exarkun
  • Branch set to branches/jelly-slots-4430

(In [28928]) Branching to 'jelly-slots-4430'

comment:4 Changed 5 years ago by exarkun

(In [28929]) Apply toidinamai's patch

refs #4430

comment:5 Changed 5 years ago by exarkun

  • Author changed from exarkun to toidinamai

comment:6 Changed 5 years ago by exarkun

  • Keywords review removed
  • Owner set to exarkun

Thanks for the patch. A few simple things:

  1. NO_STATE should probably be private
  2. Operators should have whitespace on both sides.
  3. The docs for the state parameter to _newInstance should be updated.
  4. Methods should be separated from each other by two blank lines.
  5. Everything should have a docstring (particularly test methods)
  6. Copyright date on modified files should be updated
  7. There should be a news fragment describing the change

Nothing controversial here, so I'll make the changes and apply the patch. Thanks again!

comment:7 Changed 5 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(In [28937]) Merge jelly-slots-4430

Author: toidinamai
Reviewer: exarkun
Fixes: #4430

Support jellying and unjellying objects with no __dict__ but which do
implement __getstate__ and __setstate__.

comment:8 Changed 4 years ago by <automation>

  • Owner exarkun deleted
Note: See TracTickets for help on using tickets.