This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年03月29日 07:02 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| str_partition_kind.patch | serhiy.storchaka, 2015年03月29日 07:30 | |||
| str_partition_kind_2.patch | serhiy.storchaka, 2015年03月29日 11:18 | |||
| Messages (7) | |||
|---|---|---|---|
| msg239475 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年03月29日 07:02 | |
Tests added in b923eeaf8162 exposed a bug in str.partition() and str.rpartition() in 3.4 on big-endian platforms. It should exist in 3.3 too. It likely was fixed in 3.5 in issue23573. http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.4/builds/913/steps/test/logs/stdio ====================================================================== FAIL: test_partition (test.test_unicode.UnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_unicode.py", line 383, in test_partition left + right, 'partition', delim) File "/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/string_tests.py", line 63, in checkequal realresult AssertionError: Tuples differ: ('bbbbbbbbbaaaaaaaaa', '', '') != ('', '𐌂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') First differing element 0: bbbbbbbbbaaaaaaaaa - ('bbbbbbbbbaaaaaaaaa', '', '') + ('', '𐌂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') ====================================================================== FAIL: test_rpartition (test.test_unicode.UnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_unicode.py", line 399, in test_rpartition left + right, 'rpartition', delim) File "/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/string_tests.py", line 63, in checkequal realresult AssertionError: Tuples differ: ('', '', 'bbbbbbbbbaaaaaaaaa') != ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '𐌂', '') First differing element 0: bbbb - ('', '', 'bbbbbbbbbaaaaaaaaa') + ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '𐌂', '') ---------------------------------------------------------------------- 'bbbbbbbbbaaaaaaaaa'.partition('\U00010302') returns ('', '𐌂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') 'bbbbbbbbbaaaaaaaaa'.rpartition('\U00010302') returns ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '𐌂', '') |
|||
| msg239476 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年03月29日 07:30 | |
Here is a patch that should fix the bug. Can it be committed in 3.3 Georg? The patch is simple and fixes a bug in basic type. |
|||
| msg239477 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年03月29日 07:36 | |
The bug can be reproduced on little-endian platform.
>>> 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.partition('Ā')
('A', 'Ā', 'B\x00C\x00D\x00E\x00F\x00G\x00H\x00I\x00J\x00K\x00L\x00M\x00')
>>> 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.rpartition('Ā')
('A\x00B\x00C\x00D\x00E\x00F\x00G\x00H\x00I\x00J\x00K\x00L\x00M', 'Ā', '')
|
|||
| msg239479 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年03月29日 07:52 | |
The patch lacks unit test. You showed a test which fails also on little endian. |
|||
| msg239486 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年03月29日 11:18 | |
Added tests that fail on little and big endianess. |
|||
| msg239492 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2015年03月29日 14:53 | |
lgtm |
|||
| msg239496 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年03月29日 16:24 | |
New changeset c23713af8be7 by Serhiy Storchaka in branch '3.4': Issue #23803: Fixed str.partition() and str.rpartition() when a separator https://hg.python.org/cpython/rev/c23713af8be7 New changeset c48637f57e2b by Serhiy Storchaka in branch 'default': Added explicit tests for issue #23803. https://hg.python.org/cpython/rev/c48637f57e2b |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:14 | admin | set | github: 67991 |
| 2015年04月02日 12:42:55 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2015年03月29日 16:24:21 | python-dev | set | nosy:
+ python-dev messages: + msg239496 |
| 2015年03月29日 14:53:27 | benjamin.peterson | set | messages: + msg239492 |
| 2015年03月29日 11:18:09 | serhiy.storchaka | set | files:
+ str_partition_kind_2.patch messages: + msg239486 |
| 2015年03月29日 07:52:49 | vstinner | set | messages: + msg239479 |
| 2015年03月29日 07:36:53 | serhiy.storchaka | set | messages: + msg239477 |
| 2015年03月29日 07:31:00 | serhiy.storchaka | set | files:
+ str_partition_kind.patch nosy: + georg.brandl messages: + msg239476 keywords: + patch stage: needs patch -> patch review |
| 2015年03月29日 07:02:47 | serhiy.storchaka | create | |