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

raw_input breaking with multiple futurize passes #427

Copy link
Copy link
@ghost

Description

Let's start with a python file (test.py) containing a single line:

test = raw_input("Test: ")

Pass 1: Running futurize.exe test.py --both-stages -w converts this to:

from builtins import input
test = input("Input: ")

Pass 2: Running futurize.exe test.py --both-stages -w again converts this to:

from builtins import input
test = eval(input("Input: "))

The second pass is incorrect. The presence of "from builtins import input" should indicate that the bare input has already been corrected.

Note that --both-stages can be replaced with --fix lib2to3.fixes.fix_input --fix lib2to3.fixes.fix_raw_input --fix libfuturize.fixes.fix_future_builtins.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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