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).
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).
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 "", line 1, in ? File "D:\dvt\tmp\bug2_4_1\log.py", line 356 w = 72 ^ SyntaxError: invalid syntax
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.
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.
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.