[Python-Dev] test_quopri is iso-latin-1 centric

Martin von Loewis loewis@informatik.hu-berlin.de
Fri, 3 Aug 2001 13:43:01 +0200


> I think test_quopri is too latin-1 centric.

Strictly speaking, there is nothing latin-1 centric in test_quopri.py
whatsoever.

> For instance, on my Mac, Python source is in MacRoman encoding. CVS
> knows all about this, so it happily converts the
> latin-1-upsidedown-exclam to a macroman-upsidedown-exclam, and if I
> look at the source code I see the same glyph as I see on Unix.

This is the problem. Python source code is not in Latin-1; bytes
inside strings and comments are "as-is". So the CVS "binary" mode
would come closer as to how python files should be treated, although
you'd still would want to convert line-endings.

> I'm surprised the test doesn't fail on Windows as well, or do
> Windows pythonistas generally work with source in latin1?

Most of these people probably use code page 1252, which is identical
to latin-1 except in the range 0x80 to 0x9f.

For test_quopri.py, the best thing would be to replace the characters
outside range(128) to \x escaped ones, to avoid the problem with Mac
CVS (which really is the problem here - if you unpack Python from the
source distribution, the test should pass fine on your system).

Regards,
Martin