[Pythonmac-SIG] appscript raises deprecation warning for macerrors
Bob Ippolito
bob at redivi.com
Sun Jul 10 22:04:00 CEST 2005
On Jul 10, 2005, at 9:51 AM, brad.allen at omsdal.com wrote:
> l; charset="US-ASCII"
> I just started using appscript for the first time (it's great!),
> and ran across this deprecation warning when I import appscript. It
> looks like the problem is not with appscript itself but with the
> macerrors module that it utilizes. I'm using appscript with Tiger's
> built-in Python, because that's what the appscript installer
> defaults to using. (I don't think the Python 2.4 version is
> available yet).
>
> Maybe this isn't news to anyone, but just in case, here is the
> message.
>
> Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from appscript import *
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/site-packages/aem/send/errors.py:5: DeprecationWarning:
> Non-ASCII character '\x80' in file /System/Library/Frameworks/
> Python.framework/Versions/2.3/lib/python2.3/plat-mac/macerrors.py
> on line 326, but no encoding declared; see http://www.python.org/
> peps/pep-0263.html for details
> import macerrors
> >>>
>
> To make this message go away, I had to open up macerrors.py and get
> rid of the non-ASCII characters. It turns out those characters were
> in the comments, not the actual code. There were a number of them,
> so to save time I ended up doing a Select All in BBEdit and chose
> Text-> Convert to ASCII.
That's really the wrong way to solve that problem, if you read the
PEP that the warning references then you'll see how to add a -*-
coding: -*- to the file such that it will simply interpret the source
characters in the correct encoding. In this case, it's almost
certainly macroman.
-bob
More information about the Pythonmac-SIG
mailing list