Comment on PEP 263 - Defining Python Source Code Encodings

Robin Becker robin at jessikat.fsnet.co.uk
Mon May 13 05:09:43 EDT 2002


In article <abmj00$egf$0 at 216.39.172.122>, Bengt Richter <bokr at oz.net>
writes
>On 11 May 2002 15:41:20 +0200, martin at v.loewis.de (Martin v. Loewis) wrote:
>>Robin Becker <robin at jessikat.fsnet.co.uk> writes:
>[...]
>>
>>> As for the PEP itself the only snag seems to me to be the BOM + comment
>>> problem. If I change the BOM by hitting saveAs myWeirdEncoding the file
>>> is a dead python unless I also change the comment (or is that an issue
>>> only with utf8 at present?).
>>
>>I'm not sure I understand the problem. If you do saveAs
>>myWeirdEncoding, there won't be a BOM in the file unless
>>myWeirdEncoding is UTF-8. If there are multiple conflicting encoding
>>specifications in a file, the file is in error.
>>
>I think Robin is alluding to something like the problem of an encoding-
>conversion
>save-as export filter utility fed with a script with a given encoding and 
>containing
>a magic comment. If the utility is not magic-comment-syntax-aware and able to 
>change
>the comment to reflect the new encoding, there would be a problem to fix 
>manually.
......
that was my intention, but I am not so well informed and was unable to
get my point across. Demanding duplicated information seems
intrinsically dangerous and making the comment the 'master' also seems
odd if python can deal with some future extended BOM. Comments should
surely just be hints or am I being stupid. 
>
>Regards,
>Bengt Richter

-- 
Robin Becker



More information about the Python-list mailing list