Opened 9 years ago

Closed 8 years ago

#3742 defect closed fixed (fixed)

twisted.words.test.test_jabbercomponent.ComponentAuthTest.testAuth fails on Python trunk@HEAD

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone: Python-2.7
Component: words Keywords:
Cc: Branch:


[ERROR]: twisted.words.test.test_jabbercomponent.ComponentAuthTest.testAuth

Traceback (most recent call last):
  File "/home/exarkun/Projects/Twisted/trunk/twisted/words/test/", line 84, in testAuth
    self.assertEquals(outlist[1], "<handshake>%s</handshake>" % (hv))
exceptions.IndexError: list index out of range

Change History (5)

comment:1 Changed 9 years ago by ivank

I am somewhat sure that the patch in #3847 fixes this, too.

comment:2 Changed 8 years ago by ralphm

(In [27713]) Make sure input is encoded to UTF-8 before calculating hash.

Addresses #3741, #3742, #3847.

The fix for hashPassword was rather easy, but highlights issues in how the tests in test_jabberxmlstream work.

These tests work for the happy case, but exceptions can be raised asynchronously in XPath observers, causing spurious errors in unrelated tests (#3847) if the actual test also raises an exception causing the deferred to not be returned.

I addressed this by rewriting all of those tests so the handlers also trigger deferreds we can wait for.

comment:3 Changed 8 years ago by ralphm

(In [27772]) Explicitly test for unicode as input for hashPassword, add all.

Re #3741, #3742, #3847.

comment:4 Changed 8 years ago by ralphm

Resolution: fixed
Status: newclosed

(In [27896]) Fix failing tests for Python 2.7, allow non-ascii secrets in hashPassword.

Author: ralphm. Reviewer: exarkun, TimAllen. Fixes #3741, #3742, #3847.

This lets twisted.words.protocols.jabber.xmlstream.hashPassword now only accept unicode as input. The input before hashing is encoded to UTF-8. Tests for hashPassword were added and a number of tests were rewritten to deal with asynchronous failures.

comment:5 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.