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

Appearance settings

bpo-12611: 2to3 crashes when converting doctest using reduce()#15249

Closed
aldwinaldwin wants to merge 4 commits into
python:mainpython/cpython:mainfrom
aldwinaldwin:2to3doctestreducealdwinaldwin/cpython:2to3doctestreduceCopy head branch name to clipboard
Closed

bpo-12611: 2to3 crashes when converting doctest using reduce()#15249
aldwinaldwin wants to merge 4 commits into
python:mainpython/cpython:mainfrom
aldwinaldwin:2to3doctestreducealdwinaldwin/cpython:2to3doctestreduceCopy head branch name to clipboard

Conversation

@aldwinaldwin

@aldwinaldwin aldwinaldwin commented Aug 13, 2019

Copy link
Copy Markdown
Contributor

Comment thread Lib/lib2to3/refactor.py
new = str(tree).splitlines(keepends=True)
# Adjust lineno for lines inserted before
jmp = 0
for n in new:

@corona10 corona10 Aug 26, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO
This logic can be replaced by

jmp = max(new.index('\n'), 0)

@@ -0,0 +1 @@
2to3 converting doctest using reduce(). Patch by Aldwin Pollefeyt.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2to3 converting doctest using reduce(). Patch by Aldwin Pollefeyt.
Fix 2to3 crashing when run on a doctest that uses reduce(). Patch by Aldwin Pollefeyt.

@csabella csabella requested a review from benjaminp February 4, 2020 01:17
@iritkatriel

iritkatriel commented Oct 20, 2021

Copy link
Copy Markdown
Member

Closed under bpo-45544.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.