Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 36 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesbpo-29456: bugs in unicodedata.normalize: u1176, u11a7 and u11c3 #1958
Conversation
the-knights-who-say-ni
added
the
CLA signed
label
Jun 5, 2017
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Okay, I added some tests for the issue. |
mdickinson
reviewed
Aug 2, 2017
| int LIndex, VIndex; | ||
| LIndex = code - LBase; | ||
| VIndex = PyUnicode_READ(kind, data, i+1) - VBase; | ||
| code = SBase + (LIndex*VCount+VIndex)*TCount; | ||
| i+=2; | ||
| if (i < len && | ||
| TBase <= PyUnicode_READ(kind, data, i) && | ||
| PyUnicode_READ(kind, data, i) <= (TBase+TCount)) { | ||
| TBase < PyUnicode_READ(kind, data, i) && |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Pusnow
Aug 2, 2017
•
Author
Contributor
Yes.
That code determines PyUnicode_READ(kind, data, i) is a trailing(final) consonant while TBase(0x11A7) is the last Vowel in Hangul (Hangul Jamo).
So < is correct rather than <=.
This comment has been minimized.
This comment has been minimized.
mdickinson
Aug 2, 2017
Member
Thanks! And after checking (which I should have done before leaving my comment), I see that this agrees with section 3.12 of (version 10 of ) the standard.
Still, Python eyes are rather used to seeing half-open ranges, so anything other than lower <= value < high looks surprising. Is it worth adding a comment explaining what's going on?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
animalize
Aug 10, 2017
•
Contributor
Let me give a supplement:
Before Unicode 4.1.0 (draft), here is: TBase <= code <= TBase+TCount
see: http://www.unicode.org/reports/tr15/tr15-24.html#hangul_composition
After Unicode 4.1.0, here is TBase < code < TBase+TCount, which in line with the latest version (Unicode 10.0)
see: http://www.unicode.org/reports/tr15/tr15-25.html#hangul_composition
This change happened in 2005.
This comment has been minimized.
This comment has been minimized.
|
I think it can be merged. Is there anything I need to do? |
This comment has been minimized.
This comment has been minimized.
|
Hello? |
This comment has been minimized.
This comment has been minimized.
|
@Pusnow |
This comment has been minimized.
This comment has been minimized.
|
Done, thank you for response. |
brettcannon
added
the
awaiting review
label
Feb 2, 2018
zhangyangyu
approved these changes
Jun 15, 2018
bedevere-bot
added
awaiting merge
and removed
awaiting review
labels
Jun 15, 2018
zhangyangyu
added
needs backport to 3.6
needs backport to 2.7
needs backport to 3.7
labels
Jun 15, 2018
vstinner
closed this
Jun 15, 2018
vstinner
reopened this
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
|
I closed and reopened the PR to force to reschedule a test on AppVeyor: it just started a new job, https://ci.appveyor.com/project/python/cpython/build/3.8build17701 |
zhangyangyu
merged commit d134809
into
python:master
Jun 15, 2018
9 checks passed
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jun 15, 2018
|
Thanks @Pusnow for the PR, and @zhangyangyu for merging it |
bedevere-bot
removed
the
awaiting merge
label
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jun 15, 2018
|
GH-7702 is a backport of this pull request to the 3.7 branch. |
bedevere-bot
removed
the
needs backport to 3.7
label
Jun 15, 2018
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Jun 15, 2018
bedevere-bot
removed
the
needs backport to 3.6
label
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jun 15, 2018
|
GH-7703 is a backport of this pull request to the 3.6 branch. |
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jun 15, 2018
|
Sorry, @Pusnow and @zhangyangyu, I could not cleanly backport this to |
miss-islington
assigned
zhangyangyu
Jun 15, 2018
zhangyangyu
added a commit
to zhangyangyu/cpython
that referenced
this pull request
Jun 15, 2018
zhangyangyu
added a commit
to zhangyangyu/cpython
that referenced
this pull request
Jun 15, 2018
miss-islington
added a commit
that referenced
this pull request
Jun 15, 2018
zhangyangyu
added a commit
to zhangyangyu/cpython
that referenced
this pull request
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jun 15, 2018
|
GH-7704 is a backport of this pull request to the 2.7 branch. |
Pusnow commentedJun 5, 2017
•
edited by bedevere-bot
https://bugs.python.org/issue29456