Fix UnicodeDecodeError in reconstructor _full_path function
Object paths can have non-ascii characters. Device dicts will
have unicode values. Forming a string using both will cause the
object path to be coerced to UTF8, which currently causes a
UnicodeDecodeError. This causes _get_response() to not return
and the recosntructor hangs.
The call to _full_path() is moved outside of _get_response()
(where its result is used in the exception handler logging)
so that _get_response() will always return even if _full_path()
raises an exception.
Unit tests are refactored to split out a new class with those
tests using an object name and the _full_path method, so that
the class can be subclassed to use an object name with non-ascii
characters.
Existing probe tests are subclassed to repeat using non-ascii
chars in object paths.
Reviewed: https:/ /review. openstack. org/452750 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=83750cf79c9 58810767f8a78e7 39df5d7e3f5345
Committed: https:/
Submitter: Jenkins
Branch: master
commit 83750cf79c95881 0767f8a78e739df 5d7e3f5345
Author: Alistair Coles <email address hidden>
Date: Mon Apr 3 14:01:26 2017 +0100
Fix UnicodeDecodeError in reconstructor _full_path function
Object paths can have non-ascii characters. Device dicts will deError. This causes _get_response() to not return
have unicode values. Forming a string using both will cause the
object path to be coerced to UTF8, which currently causes a
UnicodeDeco
and the recosntructor hangs.
The call to _full_path() is moved outside of _get_response()
(where its result is used in the exception handler logging)
so that _get_response() will always return even if _full_path()
raises an exception.
Unit tests are refactored to split out a new class with those
tests using an object name and the _full_path method, so that
the class can be subclassed to use an object name with non-ascii
characters.
Existing probe tests are subclassed to repeat using non-ascii
chars in object paths.
Change-Id: I4c570c08c77063 6d57b1157e19d5b 7034fd9ed4e
Closes-Bug: 1679175