SyntaxError: encoding problem: with BOM

Gabriel Genellina gagsl-py2 at
Fri Dec 26 13:08:02 CET 2008

En Thu, 25 Dec 2008 11:55:16 -0200, NoName <zaz600 at> escribió:

> Error
> ----
> C:\Documents and Settings\Ra\Рабочий стол>
>   File "<decoding error>", line 1
> SyntaxError: encoding problem: with BOM
> No error
> ----
> C:\Documents and Settings\Ra\Рабочий стол>python
> 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", not

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

Gabriel Genellina

More information about the Python-list mailing list