Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check 2to3 for support of print function. #46664

Closed
ericvsmith opened this issue Mar 18, 2008 · 6 comments
Closed

Check 2to3 for support of print function. #46664

ericvsmith opened this issue Mar 18, 2008 · 6 comments
Labels
topic-2to3 type-bug An unexpected behavior, bug, or error

Comments

@ericvsmith
Copy link
Member

BPO 2412
Nosy @ericvsmith, @benjaminp, @wolever
Files
  • print_function_detection.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-07-12.17:07:09.633>
    created_at = <Date 2008-03-18.23:42:17.813>
    labels = ['type-bug', 'expert-2to3']
    title = 'Check 2to3 for support of print function.'
    updated_at = <Date 2009-07-12.17:07:09.632>
    user = 'https://github.com/ericvsmith'

    bugs.python.org fields:

    activity = <Date 2009-07-12.17:07:09.632>
    actor = 'benjamin.peterson'
    assignee = 'collinwinter'
    closed = True
    closed_date = <Date 2009-07-12.17:07:09.633>
    closer = 'benjamin.peterson'
    components = ['2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2008-03-18.23:42:17.813>
    creator = 'eric.smith'
    dependencies = []
    files = ['10081']
    hgrepos = []
    issue_num = 2412
    keywords = ['patch']
    message_count = 6.0
    messages = ['64017', '64085', '64087', '65709', '65830', '90453']
    nosy_count = 4.0
    nosy_names = ['collinwinter', 'eric.smith', 'benjamin.peterson', 'wolever']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2412'
    versions = ['Python 2.6']

    @ericvsmith
    Copy link
    Member Author

    bpo-1633807 is a backport of the print function to 2.6, using a
    __future__ import. Once it is committed, we need to ensure that 2to3
    does the right thing (namely, nothing) with print functions in modules
    that have the __future__ import.

    @ericvsmith ericvsmith added topic-2to3 type-bug An unexpected behavior, bug, or error labels Mar 18, 2008
    @wolever wolever assigned wolever and unassigned collinwinter Mar 19, 2008
    @wolever
    Copy link
    Member

    wolever commented Mar 19, 2008

    I've updated the fixer (checkin to come shortly), but 2to3 gets upset when
    you it comes across print statements with kwargs (eg: print("spam", end="
    ")), so the tests will be commented out 'till this is fixed.

    @wolever
    Copy link
    Member

    wolever commented Mar 19, 2008

    As of r61635, the fix_print fixer has been fixed and tests have been added
    (which will assert False when 2to3 is fixed so it can handle
    print(**kwargs)).

    @wolever wolever assigned collinwinter and unassigned wolever Mar 19, 2008
    @wolever
    Copy link
    Member

    wolever commented Apr 24, 2008

    Here is a patch that will detect a from __future__ import print_function
    and adjust the grammar appropriately.

    Any objections?

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Apr 26, 2008

    Reviewing...

    @benjaminp
    Copy link
    Contributor

    Fixed in r73981.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-2to3 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants