Ticket #3742 defect closed fixed

Opened 5 years ago

Last modified 4 years ago

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

Reported by: exarkun Owned by:
Priority: normal Milestone: Python-2.7
Component: words Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

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

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

Change History

1

Changed 5 years ago by ivank

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

2

Changed 4 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.

3

Changed 4 years ago by ralphm

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

Re #3741, #3742, #3847.

4

Changed 4 years ago by ralphm

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

(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.

5

Changed 3 years ago by <automation>

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