Ticket #3817 (closed defect: fixed)

Opened 16 months ago

Last modified 16 months ago

twisted.python.rebuild.rebuild dies if something's __hash__ raises an exception other than TypeError

Reported by: z3p Owned by: z3p
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/rebuild-hash-fail-3817
Author: z3p Launchpad Bug:

Description

This came up in #3391, where PyASN1 causes this to fail test_rebuild.

Change History

Changed 16 months ago by z3p

  • branch set to branches/rebuild-hash-fail-3817
  • branch_author set to z3p

(In [26824]) Branching to 'rebuild-hash-fail-3817'

Changed 16 months ago by z3p

  • type changed from enhancement to defect

Did I say 'enhancement'? I meant 'defect'.

Changed 16 months ago by z3p

  • owner glyph deleted
  • keywords review added

Ready for review.

Changed 16 months ago by exarkun

  • status changed from new to assigned
  • owner set to exarkun

Changed 16 months ago by exarkun

  • status changed from assigned to new
  • owner changed from exarkun to z3p
  • keywords review removed
  1. twisted/test/test_rebuild.py
    1. name all new test methods test_foo instead of testFoo
    2. use two blank lines between new or modified methods and the method preceding or following; use three between a method and the start of the next class
    3. It might be nice to avoid adding an unhashable attribute to test_rebuild permanently (in case some other tool can't handle this case). The test could set the attribute when it starts and use addCleanup to make sure it is deleted when the test is over. (this is an optional review comment)

Please merge when all points are addressed.

Changed 16 months ago by z3p

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

(In [26910]) Don't fail the rebuild if an object cannot be hashed.

Author: z3p Reviewer: exarkun Fixes #3817

Previously, only a TypeError was ignored for objects during a module rebuild. Some objects raise other errors (notably the PyASN1 module) and caused the test_rebuild tests to fail.

Note: See TracTickets for help on using tickets.