2.3 encoding parsing bug
jepler at unpythonic.net
Wed Feb 18 23:35:03 CET 2004
It's unfortunate that you didn't contribute to the discussion
of PEP 263, which was created in June 2001, mentioned on
comp.lang.python.announce/python-announce at python.org as early as August
2001, discussed on comp.lang.python/python-list at python.org back in
February 2002, available as a patch in March 2002, and present
in the Python CVS around August 2002. Alpha releases of Python
(including binary releases for Windows) with the feature were available
on December 31, 2002. Leo, on the other hand, added support for its
own encoding cookie on January 21, 2002. The fatal (for LEO) dot
in the regular expression was added on February 28, 2002. I didn't
find a thread that explains why this was done, but I believe it was to
support encodings like 'japanese.sjis'
Since dotted encodings reflect a namespace hierarchy, ones with trailing
dots are nonsense. It seems to me that the easiest fix for this problem
would be to ignore a trailing dot, if it is present in the encoding
cookie. I'm at least +1/2 on that idea.
 http://python.org/sf/526840 "Date Submitted"
 http://python.org/sf/534304 "Date Closed"
 http://www.python.org/2.3/NEWS.txt "What's New in Python 2.3 alpha 1?"
More information about the Python-list