Closed williamfzc closed 4 years ago
no need to get this as e. directly raise instead of raise e should work
yes but maybe more readable?
isn't logging.warn sufficient?
yes but I did not find any logging
usage in this project so use warning
instead. I'd replace it if you prefer logging
.
logging's built-in string formatting instead
ok
Please reply in Reviewable if you can
Please reply in Reviewable if you can
ah, unfortunately I can't.
Unit test failing in PY2. Please modify so the test works both in PY2 and PY3. https://travis-ci.org/github/google/mobly/jobs/709238422
ok and I have forgotten PY2 for a long time lol
Thanks!
Hi This patch mainly related to some encoding/decoding things. When I run mobly without fastboot or adb installed, mobly will correctly raise an error, everything is fine under English env.
But if we use Windows (gbk) + other languages (Chinese? etc.), because of calling command via subprocess, stdout/stderr may contains some unexpected words in specfic language, not utf8. These words will cause decode error.
It raises an unicode expection but actually it caused by some lost deps. It's a little confused for debug. After 30 mins review finally I realized that I forgot my fastboot.
This patch will simply print out its origin value to stderr before
new_str
. Looks like:Maybe not the best design but at least I can know something wrong when I calling fastboot via command line. Just an idea/draft so feel free to edit these.
This change is![Reviewable](https://reviewable.io/review_button.svg)