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

Source with "# -*- coding: ASCII -*-" and UNIX EOL (\n) results in SyntaxError #65285

Closed
MortenZ mannequin opened this issue Mar 28, 2014 · 5 comments
Closed

Source with "# -*- coding: ASCII -*-" and UNIX EOL (\n) results in SyntaxError #65285

MortenZ mannequin opened this issue Mar 28, 2014 · 5 comments
Labels
build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@MortenZ
Copy link
Mannequin

MortenZ mannequin commented Mar 28, 2014

BPO 21086
Nosy @bitdancer
Superseder
  • bpo-20731: Python 3.3.4: SyntaxError with correct source code encoding # -- coding: latin-1 --
  • Files
  • hello_unix.py
  • hello_win.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 = None
    closed_at = <Date 2014-03-29.14:19:50.806>
    created_at = <Date 2014-03-28.15:48:48.170>
    labels = ['interpreter-core', 'build']
    title = 'Source with "# -*- coding: ASCII -*-" and UNIX EOL (\\n) results in SyntaxError'
    updated_at = <Date 2014-03-29.14:37:55.546>
    user = 'https://bugs.python.org/MortenZ'

    bugs.python.org fields:

    activity = <Date 2014-03-29.14:37:55.546>
    actor = 'Morten.Z'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-03-29.14:19:50.806>
    closer = 'Arfrever'
    components = ['Interpreter Core']
    creation = <Date 2014-03-28.15:48:48.170>
    creator = 'Morten.Z'
    dependencies = []
    files = ['34651', '34652']
    hgrepos = []
    issue_num = 21086
    keywords = []
    message_count = 5.0
    messages = ['215054', '215056', '215058', '215130', '215131']
    nosy_count = 3.0
    nosy_names = ['Arfrever', 'r.david.murray', 'Morten.Z']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '20731'
    type = 'compile error'
    url = 'https://bugs.python.org/issue21086'
    versions = ['Python 3.4']

    @MortenZ
    Copy link
    Mannequin Author

    MortenZ mannequin commented Mar 28, 2014

    Python 3.4 introduced a problem with use of

    # -- coding: ASCII --

    so when running on Windows, the EOL must be Windows type, and else an error is generated.

    See trials below:

    C:\>Python34\python.exe hello_unix.py
    File "hello_unix.py", line 3
    II -*-
    ^
    SyntaxError: invalid syntax

    C:\>Python34\python.exe hello_win.py
    Hello Python version 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) ...

    C:\>Python33\python.exe hello_unix.py
    Hello Python version 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) ...

    C:\>Python33\python.exe hello_win.py
    Hello Python version 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) ...

    @MortenZ MortenZ mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) build The build process and cross-build labels Mar 28, 2014
    @bitdancer
    Copy link
    Member

    Hmm. This might be related to bpo-20731?

    @MortenZ
    Copy link
    Mannequin Author

    MortenZ mannequin commented Mar 28, 2014

    Yes, sounds like a duplicate of http://bugs.python.org/issue20731

    But with the fix applied 2014-03-01, is the bug expected to be in 3.4 released 2014-03-17 ?

    @Arfrever
    Copy link
    Mannequin

    Arfrever mannequin commented Mar 29, 2014

    Fix was not cherry-picked to 3.4.0.
    Fix will be in 3.4.1.

    @Arfrever Arfrever mannequin closed this as completed Mar 29, 2014
    @MortenZ
    Copy link
    Mannequin Author

    MortenZ mannequin commented Mar 29, 2014

    Thank you :-D

    @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
    build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant