| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…Python 2. errors='surrogateescape' should be used for successful decoding.
|
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @abalkin, @tim-one and @birkenfeld to be potential reviewers. |
Sorry, something went wrong.
| 1 <= year[2] <= 12: | ||
| if (month is None and | ||
| isinstance(year, (bytes, str)) and len(year) == 4 and | ||
| 1 <= ord(year[2:3])&0xFF <= 12): |
There was a problem hiding this comment.
I don't understand how the last condition works. Is it supposed to allow str year with year[2] outside of 8-bit range?
Sorry, something went wrong.
There was a problem hiding this comment.
If the third byte is in the range 0x00-0x7f, it is decoded to the character in the range U+0000-U+007f. If it is in the range 0x80-0xff, it is decoded to the character in the range U+dc80-U+dcff.
Hmm, but in the latter case ord(year[2:3])&0xFF >= 0x80, and that condition is false. &0xFF is not needed in this case. But '&0x7F' in other two cases are needed.
Sorry, something went wrong.
|
Tests on Travis CI are failed for unrelated cause. |
Sorry, something went wrong.
|
The Travis CI build is failed due to some glitches. For a copy of this PR #11017 all tests are passed. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
errors='surrogateescape' should be used for successful decoding.
encoding='latin1' should be used for successful decoding.
https://bugs.python.org/issue22005