[ python-Bugs-1200686 ] SyntaxError raised on win32 for correct files

SourceForge.net noreply at sourceforge.net
Mon Sep 5 03:15:19 CEST 2005


Bugs item #1200686, was opened at 2005-05-12 10:19
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1200686&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Federico Di Gregorio (fog)
Assigned to: Nobody/Anonymous (nobody)
Summary: SyntaxError raised on win32 for correct files

Initial Comment:
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).


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2005-09-04 21:15

Message:
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.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2005-08-31 12:56

Message:
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


----------------------------------------------------------------------

Comment By: Julien Sagnard (julien_sagnard)
Date: 2005-07-20 05:37

Message:
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.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2005-07-19 12:19

Message:
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.

----------------------------------------------------------------------

Comment By: Julien Sagnard (julien_sagnard)
Date: 2005-07-19 12:05

Message:
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


----------------------------------------------------------------------

Comment By: Greg Chapman (glchapman)
Date: 2005-05-18 10:15

Message:
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).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1200686&group_id=5470


More information about the Python-bugs-list mailing list