PEP 263 status check

John Roth newsgroups at jhrothjr.com
Thu Aug 5 19:43:20 EDT 2004


"Martin v. Löwis" <martin at v.loewis.de> wrote in message
news:4112AB53.6010701 at v.loewis.de...
> John Roth wrote:
> > PEP 263 is marked finished in the PEP index, however
> > I haven't seen the specified Phase 2 in the list of changes
> > for 2.4 which is when I expected it.
> >
> > Did phase 2 get cancelled, or is it just not in the
> > changes document?
>
> Neither, nor. Although this hasn't been discussed widely,
> I personally believe it is too early yet to make lack of
> encoding declarations a syntax error. I'd like to
> reconsider the issue with Python 2.5.
>
> OTOH, not many people have commented either way: would you
> be outraged if a script that has given you a warning about
> missing encoding declarations for some time fails with a
> strict SyntaxError in 2.4? Has everybody already corrected
> their scripts?

Well, I don't particularly have that problem because I don't
have a huge number of scripts and for the ones I do it would be
relatively simple to do a scan and update - or just run them
with the unit tests and see if they break!

In fact, I think that a scan and update program in the tools
directory might be a very good idea - just walk through a
Python library, scan and update everything that doesn't
have a declaration.

The issue has popped in and out of my awareness a few
times, what brought it up this time was Hallvard's thread.

My specific question there was how the code handles the
combination of UTF-8 as the encoding and a non-ascii
character in an 8-bit string literal. Is this an error? The
PEP does not say so. If it isn't, what encoding will
it use to translate from unicode back to an 8-bit
encoding?

Another project for people who care about this
subject: tools. Of the half zillion editors, pretty printers
and so forth out there, how many check for the encoding
line and do the right thing with it? Which ones need to
be updated?

John Roth
>
> Regards,
> Martin





More information about the Python-list mailing list