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

SyntaxError raised on win32 for correct files #41976

Closed
fog mannequin opened this issue May 12, 2005 · 7 comments
Closed

SyntaxError raised on win32 for correct files #41976

fog mannequin opened this issue May 12, 2005 · 7 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@fog
Copy link
Mannequin

fog mannequin commented May 12, 2005

BPO 1200686
Nosy @tim-one, @doerwalter
Files
  • dt.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 2005-09-05.01:15:19.000>
    created_at = <Date 2005-05-12.14:19:31.000>
    labels = ['interpreter-core']
    title = 'SyntaxError raised on win32 for correct files'
    updated_at = <Date 2005-09-05.01:15:19.000>
    user = 'https://bugs.python.org/fog'

    bugs.python.org fields:

    activity = <Date 2005-09-05.01:15:19.000>
    actor = 'tim.peters'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2005-05-12.14:19:31.000>
    creator = 'fog'
    dependencies = []
    files = ['1699']
    hgrepos = []
    issue_num = 1200686
    keywords = []
    message_count = 7.0
    messages = ['25292', '25293', '25294', '25295', '25296', '25297', '25298']
    nosy_count = 5.0
    nosy_names = ['tim.peters', 'doerwalter', 'glchapman', 'fog', 'julien_sagnard']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1200686'
    versions = ['Python 2.4']

    @fog
    Copy link
    Mannequin Author

    fog mannequin commented May 12, 2005

    Try to import the attached file (dt.py) on Windows with
    Python 2.4 or 2.4.1 and you'll get a SyntaxError (the
    file was written a long time ago, and worked perfectly
    well on Python 2.1, 2.2 and 2.3.) The same does not
    happen when importing the same module on Linux (tested
    with 2.4 and 2.4.1). When the module imports fine
    you'll get an ImportError (don't want to attach all
    dependencies here) but the SyntaxError comes before that.

    Also note that compiling the file with
    compiler.compileFile("dt.py") generates a perfectly
    good .pyc file that can be later imported just fine
    (tested with 2.4 and 2.4.1 on Windows).

    @fog fog mannequin closed this as completed May 12, 2005
    @fog fog mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 12, 2005
    @fog fog mannequin closed this as completed May 12, 2005
    @fog fog mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 12, 2005
    @glchapman
    Copy link
    Mannequin

    glchapman mannequin commented May 18, 2005

    Logged In: YES
    user_id=86307

    I'm fairly sure this is caused by the bug described here:

    www.python.org/sf/1175396

    The module imports without syntax error on my Windows system
    (with a patched codecs.py to work around the above bug).

    @juliensagnard
    Copy link
    Mannequin

    juliensagnard mannequin commented Jul 19, 2005

    Logged In: YES
    user_id=1181710

    I have a similar problem with an other file (log.py).
    On my computer ( Windows 2000 ) this 2 files ( log.py and
    dt.py ) works with python 2.4 but raise a syntax error on
    python 2.4.1 :

    D:\dvt\tmp\bug2_4_1>python -c "import log"
    Traceback (most recent call last):
      File "<string>", line 1, in ?
      File "D:\dvt\tmp\bug2_4_1\log.py", line 356
          w = 72
           ^
    SyntaxError: invalid syntax

    @doerwalter
    Copy link
    Contributor

    Logged In: YES
    user_id=89016

    This bug should be fixed in the current CVS version. So, can
    you retry with current CVS? As a workaround you might also
    want to remove the PEP-263 coding declaration if you don't
    have any special character in your file.

    @juliensagnard
    Copy link
    Mannequin

    juliensagnard mannequin commented Jul 20, 2005

    Logged In: YES
    user_id=1181710

    It's ok if I remove coding declaration.
    I have no access to current cvs, but if someone send me a
    zip with latest version, I can try it.

    @doerwalter
    Copy link
    Contributor

    Logged In: YES
    user_id=89016

    Copying codecs.py from current CVS (2.4 branch) over your
    codecs.py (making a backup first) should be sufficient to
    test this. You can this version from
    http://cvs.sourceforge.net/viewcvs.py/*checkout*/python/python/dist/src/Lib/codecs.py?rev=1.35.2.9

    @tim-one
    Copy link
    Member

    tim-one commented Sep 5, 2005

    Logged In: YES
    user_id=31435

    dt.py imports fine (except for the ImportError the OP
    mentioned) under current CVS HEAD and under current 2.4
    maintenance branch, on Windows XP Pro SP2, so closing
    this as fixed.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants