[issue11828] startswith and endswith don't accept None as slice index

2011-11-08 Thread Guido van Rossum
Guido van Rossum added the comment: As I wrote in python-dev: I agree with Raymond that this should be treated as a feature request and not "fixed" in 2.7 / 3.2. (However the mention of 'find' in the error message for 'index' is a bug and should be fixed.) As for the feature request, I think

[issue11828] startswith and endswith don't accept None as slice index

2011-04-20 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- assignee: -> jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue11828] startswith and endswith don't accept None as slice index

2011-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f4da64529e8c by Jesus Cea in branch '2.7': startswith and endswith don't accept None as slice index. Patch by Torsten Becker. (closes #11828) http://hg.python.org/cpython/rev/f4da64529e8c New changeset 77c657e47b5c by Jesus Cea in branch '3.1': st

[issue11828] startswith and endswith don't accept None as slice index

2011-04-20 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : Added file: http://bugs.python.org/file21739/87be2a5e22ed.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue11828] startswith and endswith don't accept None as slice index

2011-04-19 Thread Torsten Becker
Torsten Becker added the comment: Hi, Jesús, I merged the patch up in the branches "startswith-slices-issue11828-3.2" [1] and "startswith-slices-issue11828-3.3" [2] in my hg repository. [1]: https://bitbucket.org/t0rsten/cpython/changeset/49028581e43a [2]: https://bitbucket.org/t0rsten/cpytho

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Torsten, could you possibly publish branches too for 3.2 and default (3.3)? -- ___ Python tracker ___

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread Torsten Becker
Changes by Torsten Becker : Removed file: http://bugs.python.org/file21706/2b48fd451c85.diff ___ Python tracker ___ ___ Python-bugs-list maili

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread Torsten Becker
Changes by Torsten Becker : -- hgrepos: +22 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread Torsten Becker
Changes by Torsten Becker : Added file: http://bugs.python.org/file21706/2b48fd451c85.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread Torsten Becker
Torsten Becker added the comment: I pushed my changes to a hg repository, they are in the two branches "startswith-slices-issue11828-2.7" and "startswith-slices-issue11828-3.1". -- hgrepos: +21 ___ Python tracker

[issue11828] startswith and endswith don't accept None as slice index

2011-04-18 Thread R. David Murray
Changes by R. David Murray : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Torsten Becker
Changes by Torsten Becker : Added file: http://bugs.python.org/file21656/issue-11828-v4-2.7.patch ___ Python tracker ___ ___ Python-bugs-list

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Torsten Becker
Torsten Becker added the comment: > I got your comments, Torsten. I finds funny too that the tracker is > not notified. > I wrote new comments too, but not using "the right way", so now I am > the one not sure you got them... :-) That time I actually got a separate mail. :) > Better to have a

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Better to have a 3.1/2.7 patch. The current workflow requires to patch the old version first (3.1), and up-port the change to 3.2 and 3.3. So, 2.7 and 3.1 would be more useful. Al least if the patch applies to 3.2 and 3.3 easily. If major surgery is needed,

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: I got your comments, Torsten. I finds funny too that the tracker is not notified. I wrote new comments too, but not using "the right way", so now I am the one not sure you got them... :-) Go for the 3.3/2.7 patch. Thanks. -- __

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Torsten Becker
Torsten Becker added the comment: > Some comments posted in the review. I'm not sure if my review reply got mailed as I did not get a copy and nothing showed up here. I added some responses/follow up questions in the review. > Could you possibly post a patch for 2.7 too?. Sure, I'll write t

[issue11828] startswith and endswith don't accept None as slice index

2011-04-13 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Some comments posted in the review. Could you possibly post a patch for 2.7 too?. Thanks. If any other reviewer agree, I will commit the patch. -- ___ Python tracker _

[issue11828] startswith and endswith don't accept None as slice index

2011-04-12 Thread Torsten Becker
Torsten Becker added the comment: Hi, since nobody stopped me by complaining about the approach or the first patch, I now fixed this for bytes and bytearray as well. :) I renamed the old _ParseTupleFinds function to stringlib_parse_tuple_finds, added a parameter for function name, and another

[issue11828] startswith and endswith don't accept None as slice index

2011-04-12 Thread Torsten Becker
Changes by Torsten Becker : Removed file: http://bugs.python.org/file21623/issue-8282-error-message-tests.patch ___ Python tracker ___ ___ Py

[issue11828] startswith and endswith don't accept None as slice index

2011-04-12 Thread Torsten Becker
Changes by Torsten Becker : Added file: http://bugs.python.org/file21627/issue-11828-error-msg-tests.patch ___ Python tracker ___ ___ Python-b

[issue11828] startswith and endswith don't accept None as slice index

2011-04-12 Thread Torsten Becker
Torsten Becker added the comment: Just realized that part of my v1 patch did not conform to PEP 7, I hope, I fixed that in v2. Please also excuse for the wrong name of the error message patch, it was supposed to be named "issue-11828-error-msg-tests.patch". -- Added file: http://bugs

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Torsten Becker
Torsten Becker added the comment: While working on this, I discovered anther problem. find(), etc. all use the same parsing function (_ParseTupleFinds()). So when an error occurs, the exception message will always start with "find()" even though index() or rfind() might have caused the erro

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Torsten Becker
Torsten Becker added the comment: Hi, I started working on a first patch for this. A function _ParseTupleFinds() exists which does the proper parsing for this kind of arguments in unicodeobject.c, I adapted it to be usable for startswith() and endswith() besides find() and friends. In issue

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Anybody taking care of this, should check also "byte" and "bytearray". -- ___ Python tracker ___ _

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Letting None be used as an index has always been treated as a feature request; however, in this case, it can be deemed a bug because the error message is making a promise that isn't kept. It would be nice if once and for all this got solved by making argum

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread R. David Murray
R. David Murray added the comment: Well, if it is judged a bug (and it seems to me that it is), then it can get fixed in 2.7 and 3.2 (and yes I did confirm that the same bug is present in 2.7). It appears to be the result of startswith/endswith applying naive parsing to their arguments rathe

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Since this is not a regression, this would be solved in 3.3 only. I guess. -- nosy: +jcea ___ Python tracker ___ _

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- versions: +Python 3.2 -Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Marijn Schouten
Marijn Schouten added the comment: I remark that `find' and `index' do accept None: $ python3 -c "print('abc'.find('c',None,None))" 2 -- ___ Python tracker ___

[issue11828] startswith and endswith don't accept None as slice index

2011-04-11 Thread Marijn Schouten
New submission from Marijn Schouten : startswith and endswith don't accept None as slice index, as shown by below interaction. Same behavior for python-3.1.3(with print()) and python-2.7.1. If instead this is intended behavior then the error message is wrong. $ python -c "print 'abc'[-1:None]"