[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you Marc, your patches are now committed! -- components: +Library (Lib) resolution: -> fixed stage: -> committed/rejected status: open -> closed type: enhancement -> behavior ___ Python tracker

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset b0605b34b2de by Antoine Pitrou in branch 'default': Issue #15225: improve error message when hmac is passed a wrong key type. http://hg.python.org/cpython/rev/b0605b34b2de -- nosy: +python-dev ___ Python

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Marc Abramowitz
Changes by Marc Abramowitz : -- type: -> enhancement Added file: http://bugs.python.org/file26220/test_hmac.py.patch ___ Python tracker ___ _

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Marc Abramowitz
Marc Abramowitz added the comment: Updating patch -- Added file: http://bugs.python.org/file26219/hmac.py.patch ___ Python tracker ___ __

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: You don't need to call self.fail(), assertRaises() will do it for you. -- nosy: +pitrou ___ Python tracker ___

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-29 Thread Marc Abramowitz
Marc Abramowitz added the comment: And here is the tiny patch to make it clear in the error message which of the 3 arguments had the wrong type -- I follow the convention followed in some TypeErrors raised in Lib/zipfile.py -- Added file: http://bugs.python.org/file26213/hmac.py.patch

[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-29 Thread Marc Abramowitz
New submission from Marc Abramowitz : I had been thinking of improving the error message for this case slightly -- and then couldn't find a test for this case so I'm adding one in the attached patch... -- components: Tests files: test_hmac.py.patch keywords: patch messages: 164348 nosy