SyntaxError: encoding problem: with BOM

NoName zaz600 at gmail.com
Fri Dec 26 22:52:50 EST 2008


On 26 дек, 23:08, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Thu, 25 Dec 2008 11:55:16 -0200, NoName <zaz... at gmail.com> escribió:
>
> > Error
> > ----
> > C:\Documents and Settings\Ra\Рабочий стол>11.py
> >   File "<decoding error>", line 1
> > SyntaxError: encoding problem: with BOM
>
> > No error
> > ----
> > C:\Documents and Settings\Ra\Рабочий стол>python 11.py
> > test
>
> > Error when russian symbols in full path to py-script.
> > Is it Python bug? or i need to modify some registry keys?
>
> Yes, it's a bug. The encoding declaration may be anything, ascii, even an
> inexistent codec will trigger the bug. Any non-ascii character in the
> script name or path provokes then a SyntaxError when the script is
> executed directly.
> As a workaround, avoid using any Russian characters in directory names or
> script file names, or invoke them always using "python xxx.py", not
> directly.
>
> > OS: WinXP SP3 Russian.
> > Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
> > (Intel)] on win32
>
> My tests were on WinXP SP3 Spanish.
> Seehttp://bugs.python.org/issue4747
>
> --
> Gabriel Genellina


Gabriel Genellina, thanks for bug report =)




More information about the Python-list mailing list