Issue1772858

classification
Title: Fix for bug [1768074] : Str replace
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: ayeshaiqbal, cgroves
Priority: normal Keywords: patch

Created on 2007-08-13.05:20:45 by ayeshaiqbal, last changed 2007-09-22.19:02:14 by cgroves.

Files
File name Uploaded Description Edit Remove
strreplace.patch ayeshaiqbal, 2007-08-24.05:46:56 patch file
Messages
msg2791 (view) Author: ayesha (ayeshaiqbal) Date: 2007-08-13.05:20:45
I have uploaded a patch for the bug 1768074 :str.replace() doesn't handle an empty string to be replaced.With this patch now str.replace does not throw ValueError on receiving an empty string as a parameter.Instead it's functionality on receiving an empty string is identical to it's behaviour in python

Thanks,
Ayesha
msg2792 (view) Author: Charlie Groves (cgroves) Date: 2007-08-14.05:36:29
This patch doesn't enable the tests mentioned in the bug report, and when they are enabled, they fail.  See http://wiki.python.org/jython/VersionTransition for how to work on the bugs in the test failure causes group.

Also, this patch is relative to the core directory and uses tabs instead of spaces.  See http://wiki.python.org/jython/PatchGuidelines for instructions on making a patch.
msg2793 (view) Author: ayesha (ayeshaiqbal) Date: 2007-08-16.09:33:47
i have attached a new modified patch which includes diff of both PyString.java and test case related to that.

File Added: patch_strreplace.diff
msg2794 (view) Author: Charlie Groves (cgroves) Date: 2007-08-16.16:10:24
First, this patch still isn't following the instructions in the guidelines page on the wiki.  The two patch segments in it aren't relative to the root of a jython checkout, so they have to be specified manually.  See the bit about running svn diff from the base of a checkout.

Secondly, the tests you uncommented still fail.  string_tests are a set of tests run by test_str, test_userstring and test_unicode.  If you run any of them with your updated string_tests, you can see the failures.
msg2795 (view) Author: ayesha (ayeshaiqbal) Date: 2007-08-24.05:46:56
I have attached a new patch. With this patch now all three tests are succeeding for str_replace .
Also for negative value of maxsplit given an empty string to be replaced this patch will return the same value for python and jython(this is not checked by the test files).
File Added: strreplace.patch
msg2796 (view) Author: Charlie Groves (cgroves) Date: 2007-09-22.19:02:14
Applied in r3509.  Jython uses spaces instead of tabs for indentation, so I fixed that.
History
Date User Action Args
2007-08-13 05:20:45ayeshaiqbalcreate