Fix UnicodeDecodeError when commit message contains non-ascii character
Review Request #10121 — Created Aug. 15, 2018 and discarded
subprocess output data is str type, convert it to unicode when results_unicode is true
- Posted some changes.
- Ran unit tests.
- Commit:
-
c62c7a2fd48eb9f23794aef00a59469b2463fab2f6ddaad3796e356c3dc7b81d2539662909b03bf8
- Diff:
-
Revision 2 (+3 -2)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Commit:
-
f6ddaad3796e356c3dc7b81d2539662909b03bf8b99e3d8179a25e26dc69ffe64dcb59590b495200
- Diff:
-
Revision 3 (+3)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Commit:
-
b99e3d8179a25e26dc69ffe64dcb59590b495200e15fd2d87df5cdcdca29280a77c49344d7b3f365
- Diff:
-
Revision 4 (+3)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Summary:
-
Fix UnicodeDecodeError when stamp commit message with non-ascii characterFix UnicodeDecodeError when commit message contains non-ascii character
- Description:
-
~ commit_message returned by GitClient.get_raw_commit_message() is str type, stamp_string is unicode type.
~ subprocess output data is str type, convert it to unicode when results_unicode is true
- - since default encoding is 'ascii', if the commit_message contains non-ascii character,
- statement if stamp_string in commit_message:
will throw UnicodeDecodeError - Testing Done:
-
~ testing done under python2.7.15 and python 3.7.0
~ - Posted some changes.
+ - Ran unit tests.
- Commit:
-
e15fd2d87df5cdcdca29280a77c49344d7b3f365208eae4651a8ebca4c452fb3fcff2a1c9b978521
Checks run (1 succeeded, 1 failed with error)
flake8
internal error.
JSHint
passed.
- Commit:
-
208eae4651a8ebca4c452fb3fcff2a1c9b978521ada54f6934d45141d23ddd35c6e00330f619d5a1
Checks run (1 succeeded, 1 failed with error)
flake8
internal error.
JSHint
passed.
- Commit:
-
ada54f6934d45141d23ddd35c6e00330f619d5a1652624311195820212f58fa5a638d6ddabbc8e73
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.