Anything like 'inspect.getsourceencoding()'?

Jeff Epler jepler at unpythonic.net
Sun Oct 17 04:14:34 CEST 2004


Is there a convenient way to find the encoding of a source file?  I
thought maybe this would be in the inspect module, but I didn't see it
there.  Just as nice would be a way to get the file as a unicode string,
I suppose.

(This is related to another thread I've recently posted to, where
another user was having trouble with pydoc's links to source files using
the file: protocol.  I suggested having pydoc serve the source files,
and provided a patch, but it's crossed my mind that it would be nice to
tell the browser the encoding of that file.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20041016/7e532cc1/attachment.pgp>


More information about the Python-list mailing list