[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2017-01-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 35334a4d41aa by Stefan Krah in branch '3.5': Issue #28701: Revert part of 5bdc8e1a50c8 for the following reasons: https://hg.python.org/cpython/rev/35334a4d41aa -- ___ Python tracker

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2017-01-07 Thread Stefan Krah
Stefan Krah added the comment: For the record: This is all that happened in decimal if a) you pass a legacy string and b) force _PyUnicode_Ready() to throw a MemoryError: >>> from decimal import * >>> import _testcapi >>> context = Context() >>> traps = _testcapi.unicode_legacy_string('traps') >

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6dd22ed7140e by Serhiy Storchaka in branch '3.6': Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString now https://hg.python.org/cpython/rev/6dd22ed7140e New changeset 44874b20e612 by Serhiy Storchaka in branch 'default': Issue

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: _PyUnicode_EqualToASCII-runtime-check.diff LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following patch adds checks in debug mode that the right argument of _PyUnicode_EqualToASCIIString and _PyUnicode_EqualToASCIIId is ASCII-only string. -- Added file: http://bugs.python.org/file45505/_PyUnicode_EqualToASCII-runtime-check.diff __

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b607f835f170 by Serhiy Storchaka in branch '3.5': Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). https://hg.python.org/cpython/rev/b607f835f170 New changeset 1369e51182b7 by Serhiy Storchaka in branch '3.6': Fixed an off-

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The correct issue for above commits is issue21449. -- ___ Python tracker ___ ___ Python-bugs-list

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset faf04a995031 by Serhiy Storchaka in branch '3.5': Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId. https://hg.python.org/cpython/rev/faf04a995031 New changeset ff3dacc98b3a by Serhiy Storchaka in branch '3.6': Issue #28

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: I suggest "return 0 in release build and crash in debug build". -- ___ Python tracker ___ ___ Python

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Can you please also document the behaviour if you pass two non-ASCII strings > which are equal? What mean "equal"? The left argument is a Unicode string, but the right argument is a byte string. For comparing them we should decode right argument or encode

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: (I reopen the issue to ask my question :-)) +/* Test whether a unicode is equal to ASCII string. Return 1 if true, + 0 otherwise. Return 0 if any argument contains non-ASCII characters. + Any error occurs inside will be cleared before return. */ Can you p

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Xiang and Inada for your reviews. The patch fixes a bug: error is not checked after PyUnicode_CompareWithASCIIString(). The patch is not applicable to 2.7 since PyUnicode_CompareWithASCIIString() is Python 3 only. -- assignee: -> serhiy.stor

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 386c682dcd75 by Serhiy Storchaka in branch '3.5': Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString. https://hg.python.org/cpython/rev/386c682dcd75 New changeset 72d07d13869a by Serhiy Storchaka in branch '3.

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-15 Thread INADA Naoki
INADA Naoki added the comment: Patch LGTM. But I don't know it's OK to commit it on 2.7, 3.5 and 3.6. -- nosy: +inada.naoki ___ Python tracker ___ ___

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45491/PyUnicode_CompareWithASCIIString.cocci ___ Python tracker ___ ___

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch replaces calls of public function PyUnicode_CompareWithASCIIString() with new private function _PyUnicode_EqualToASCIIString(). The problem with PyUnicode_CompareWithASCIIString() is that it returns -1 for the result "less than" and error,