Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FixIndexError inpydoc.replace #136572

Closed as not planned
Closed as not planned
Assignees
picnixz
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@picnixz

Description

@picnixz

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 dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp