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

2to3 truncates files at formfeed character #55459

Closed
cgohlke mannequin opened this issue Feb 19, 2011 · 6 comments
Closed

2to3 truncates files at formfeed character #55459

cgohlke mannequin opened this issue Feb 19, 2011 · 6 comments
Assignees

Comments

@cgohlke
Copy link
Mannequin

cgohlke mannequin commented Feb 19, 2011

BPO 11250
Nosy @warsaw, @benjaminp
Files
  • formfeedbug.py
  • 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 = 'https://github.com/warsaw'
    closed_at = <Date 2011-10-07.19:46:01.553>
    created_at = <Date 2011-02-19.23:57:24.087>
    labels = ['expert-2to3']
    title = '2to3 truncates files at formfeed character'
    updated_at = <Date 2011-10-07.19:46:01.552>
    user = 'https://bugs.python.org/cgohlke'

    bugs.python.org fields:

    activity = <Date 2011-10-07.19:46:01.552>
    actor = 'barry'
    assignee = 'barry'
    closed = True
    closed_date = <Date 2011-10-07.19:46:01.553>
    closer = 'barry'
    components = ['2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2011-02-19.23:57:24.087>
    creator = 'cgohlke'
    dependencies = []
    files = ['20800']
    hgrepos = []
    issue_num = 11250
    keywords = []
    message_count = 6.0
    messages = ['128885', '129602', '145046', '145095', '145118', '145129']
    nosy_count = 4.0
    nosy_names = ['barry', 'benjamin.peterson', 'cgohlke', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue11250'
    versions = ['Python 2.7', 'Python 3.2']

    @cgohlke
    Copy link
    Mannequin Author

    cgohlke mannequin commented Feb 19, 2011

    Running Tools/Scripts/2to3.py on Python 3.2rc3 or 2.7.1 for Windows on a file that contains a formfeed character (0x0C, <FF>) results in a truncated file.

    E.g. a file (attached) with the content

    print 1
    <FF>
    print 2

    is incorrectly refactored:

    @@ -1,4 +1,1 @@
    -print 1
    -
    -
    -print 2
    +print(1)

    Python 2.6.6 and 3.1.3 correctly refactor the file:

    -print 1
    +print(1)
     <FF>
    -print 2
    +print(2)

    @cgohlke cgohlke mannequin added the topic-2to3 label Feb 19, 2011
    @benjaminp
    Copy link
    Contributor

    r88661

    @warsaw
    Copy link
    Member

    warsaw commented Oct 6, 2011

    Was this patch ever folded into Python 3.2? Looking at the hg repository, I think the answer is "no". It does appear to have made it into Python 2.7 and trunk though (afaict).

    In point of fact, this bug is hitting me now with 3.2.2.

    @warsaw warsaw reopened this Oct 6, 2011
    @warsaw
    Copy link
    Member

    warsaw commented Oct 7, 2011

    I also noticed that test_parser.py isn't being run in either 3.2 or 3.3. I'll fix that at the same time I port this patch to 3.2.

    @warsaw warsaw self-assigned this Oct 7, 2011
    @warsaw
    Copy link
    Member

    warsaw commented Oct 7, 2011

    Okay, re-enabling test_parser.py introduces a number of test failures in test_all_project_files(). Because I don't want to continue to shave the yak on this one, I'm going to wrap this test in @expectedfailure and open a separate bug for it.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 7, 2011

    New changeset 6e0e9237d8e8 by Barry Warsaw in branch '3.2':

    @warsaw warsaw closed this as completed Oct 7, 2011
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants