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

SourceForge.net noreply at sourceforge.net
Wed Jul 20 11:37:18 CEST 2005


Bugs item #1200686, was opened at 2005-05-12 16:19
Message generated for change (Comment added) made by julien_sagnard
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: Open
Resolution: None
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: Julien Sagnard (julien_sagnard)
Date: 2005-07-20 11: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 18: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 18: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 16: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