Issue1768074

classification
Title: str.replace doesn't handle an empty string to be replaced
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ayeshaiqbal, cgroves, pjenvey
Priority: normal Keywords: test failure causes

Created on 2007-08-06.00:15:46 by cgroves, last changed 2007-09-22.19:03:14 by cgroves.

Messages
msg1803 (view) Author: Charlie Groves (cgroves) Date: 2007-08-06.00:15:46
str.replace should allow '' as the string to be replaced, but it fails with a ValueError.  This is tested by string_tests(and thereby test_str, test_userstring and test_unicode), but is currently commented out.  See http://wiki.python.org/jython/JythonDeveloperGuide/VersionTransitionTestExclusions for instructions on how to enable the test and work on fixing the problem.
msg1804 (view) Author: ayesha (ayeshaiqbal) Date: 2007-08-13.03:54:43
With the attached patch the ValueError is not raised and str.replace() with an empty string in jython behaves in a similar fashion as in python.Can someone please verify the patch
msg1805 (view) Author: Philip Jenvey (pjenvey) Date: 2007-08-16.01:01:37
ayeshaiqbal - There's no patch attached here
msg1806 (view) Author: Charlie Groves (cgroves) Date: 2007-09-22.19:03:14
The patch is at http://jython.org/patches/1772858 and I applied it in r3509.
History
Date User Action Args
2007-08-06 00:15:46cgrovescreate