Anything like 'inspect.getsourceencoding()'?
"Martin v. Löwis"
martin at v.loewis.de
Sun Oct 17 12:56:02 EDT 2004
More information about the Python-list mailing list
Sun Oct 17 12:56:02 EDT 2004
- Previous message (by thread): Anything like 'inspect.getsourceencoding()'?
- Next message (by thread): Anything like 'inspect.getsourceencoding()'?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jeff Epler wrote: > 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. No. inspect operates on the byte-code/internal representation level, and at that level, there is no notion of source encoding. The source encoding information gets lost during compilation (as it is no longer needed). Somebody proposed preserving it in __[en]coding__, but that hasn't been implemented. Regards, Martin
- Previous message (by thread): Anything like 'inspect.getsourceencoding()'?
- Next message (by thread): Anything like 'inspect.getsourceencoding()'?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list