[New-bugs-announce] [issue7813] Bug of command-line module launcher
Pascal Chambon
report at bugs.python.org
Sat Jan 30 16:59:14 CET 2010
New submission from Pascal Chambon <chambon.pascal at gmail.com>:
I have a weird behaviour of the interpreter on my python2.6 win32 install : if I launch as __main__ the file joined below, like "python test_rsFileLocking.py", all works fine.
But if I put it in my PYTHONPATH (or current working directory), and launch it via the "-m" option of python.exe, I get this unexplanatory traceback below.
How comes the syntax analyser is not the same in both cases ? I don't what what, in this file, could give syntax errors in the latter case...
C:\Users\Pakal\Desktop\release26-maint\PCbuild>python.exe -m rstest.test_rsFileLocking
Traceback (most recent call last):
File "C:\Users\Pakal\Desktop\release26-maint\lib\runpy.py", line 104, in _run_module_as_main
loader, code, fname = _get_module_details(mod_name)
File "C:\Users\Pakal\Desktop\release26-maint\lib\runpy.py", line 85, in _get_module_details
code = loader.get_code(mod_name)
File "C:\Users\Pakal\Desktop\release26-maint\lib\pkgutil.py", line 275, in get_code
self.code = compile(source, self.filename, 'exec')
File "C:\Users\Pakal\Desktop\RockSolidTools\rstest\test_rsFileLocking.py", line 391
SyntaxError: invalid syntax
----------
components: Interpreter Core
files: test_rsFileLocking.py
messages: 98566
nosy: pakal
severity: normal
status: open
title: Bug of command-line module launcher
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file16057/test_rsFileLocking.py
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7813>
_______________________________________
More information about the New-bugs-announce
mailing list