-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed as not planned
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Proposal:
We should instead raise a ValueError:
$ ./python -c "import pydoc; pydoc.replace('text', 'a')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
import pydoc; pydoc.replace('text', 'a')
~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/projects/python/cpython/Lib/pydoc.py", line 266, in replace
text = pairs[1].join(text.split(pairs[0]))
~~~~~^^^
IndexError: tuple index out of range
Note
Since I changed the exception type, I won't backport this.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error