forked from sonic-net/sonic-mgmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Python3 str decode issues (sonic-net#14332)
What is the motivation for this PR? This fixes an issue due to Python 3 migration, where decode() is no longer a method of str. How did you do it? For cases where we actually need the unicode-escape conversion, I convert to bytes first, then re-decode to str to decode the escape sequences. In other cases where we are just taking the raw output of a command, I just removed the decode(). How did you verify/test it? I ran the relevant sonic-mgmt tests and verified that the tests now pass and no longer raise exceptions due to decode() not being a method of str or AnsibleUnsafeText.
- Loading branch information
1 parent
6fe4aec
commit 3e8708d
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters