[Tutor] upgrading Python

Kent Johnson kent37 at tds.net
Mon Oct 15 13:49:04 CEST 2007


LandSurveyor wrote:
>  Some interesting (!?) things happened when I upgraded from Python 2.3 
> to Python 2.5.1.  My editor of choice is Vim, the platform is 
> MandrakeLinux 10.1...
> 
>     * the digraphs I have incorporated from the Vim environment into my
>       scripts no longer work.  The resultant error message referred me
>       to pep-0263

I guess this means that you have non-ascii characters in your source 
code but you have not included an encoding declaration. From "What's New 
in Python 2.5":

ASCII is now the default encoding for modules. It's now a syntax error 
if a module contains string literals with 8-bit characters but doesn't 
have an encoding declaration. In Python 2.4 this triggered a warning, 
not a syntax error. See PEP 263 for how to declare a module's encoding; 
for example, you might add a line like this near the top of the source file:
# -*- coding: latin1 -*-

http://www.python.org/dev/peps/pep-0263/

Kent


More information about the Tutor mailing list