[Python-3000] PEP 3131 accepted
Guido van Rossum
guido at python.org
Thu May 24 04:26:31 CEST 2007
The tokenize module could easily be used to do such tests, as lenient
or as strict as required by any particular style guide.
On 5/23/07, Guillaume Proux <gproux+py3000 at gmail.com> wrote:
> Regarding using looking-alike glyphs (in certain fonts) security
> issues, wouldn't it be a good thing for any project anyway to have a
> number of pre-conditions for any given contribution to a given project
> to be cleared. On of such litmus tests would be like the following.
> print("contribution accepted")
> except UnicodeDecodeError:
> print("contribution rejected. evil non-ascii characters lurking
> in your source. ")
> (it should be possible (and this is left as exercise to the reader) to
> use some regexp to first remove from the scope of the test strings and
> comments or to use AST tools to make the tests directly on the
> generated AST)
> In Japan, replace the above "ascii" by "sjis" for example.
> it should be fairly easy to write a number of tools that would
> highlight "strange" characters in a piece of source code and I trust
> that if there is such a need, the market for python specialized
> editors (and other generic editors) will let you pick a different
> color for characters that would not be part of the ascii set. Once
> again, mostly a presentation and workflow issue that can be solved by
> using the right tools or writing some very simple tools to work around
> your favorite editor's lacks.
> Python-3000 mailing list
> Python-3000 at python.org
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000