Thanks for the threatpost link. Indeed a good think to be aware of. I'ts
just a bit sad that once again, hackers are winning in a sense :-(
I like the proposal of Peter, alowing unicode for test files. Because
Unicode is rather useful in tests. Typically, it's just more friendly to
para = Paragraph("Viele Grüße")
para = Paragraph(b'Viele Gr\xc3\xbc\xc3\x9fe'.decode('utf-8'))
Le 21.02.22 à 12:02, Peter Cock a écrit :
I agree that Peter's suggestion is probably a good way forward. It would keep homoglyph stuff away from the isnatllation
Let's give it a few days in case others want to have a say. Perhaps there are experts who know what python is doing
about it. I saw a lot about editors etc etc in the python-dev list discussion.
As it stands the existing test uses this for the search folder reportlab.lib.testutils.RL_HOME and that is None by
default, but our tests use setOutDir which calculates it as
> import reportlab
> if not os.path.isabs(RL_HOME): RL_HOME=os.path.normpath(os.path.abspath(RL_HOME))
so currently I think the tests folder may be outside the test for ascii even if import reportlab resolves to
As for this test; the initial code was checked in by Dinu Gherman in 2001;
the message wasn't very informative 'Initial checkin.'. It might just have been a method for him to prevent usage of
umlauts, which might well have caused problems in those days. Certainly python was not using unicode at that time.
On 21/02/2022 11:27, Claude Paroz wrote:
> Hi Robin, Peter,
> Thanks for the threatpost link. Indeed a good think to be aware of. I'ts just a bit sad that once again, hackers are
> winning in a sense :-(
> I like the proposal of Peter, alowing unicode for test files. Because Unicode is rather useful in tests. Typically, it's
> just more friendly to write:
> para = Paragraph("Viele Grüße")
> para = Paragraph(b'Viele Gr\xc3\xbc\xc3\x9fe'.decode('utf-8'))
> Le 21.02.22 à 12:02, Peter Cock a écrit :
>> That's a good point Robin, something I'll keep in mind for other Python projects.
>> Generally it has only been people's names where I/we have needed this (things
>> like contributor listings or references in comments/docstrings).
>> Would it be a helpful compromise to allow unicode Python files for the tests only?
>> On Mon, Feb 21, 2022 at 10:51 AM Robin Becker <ro...@reportlab.com <mailto:ro...@reportlab.com>> wrote:
>> Hi Claude,
>> I am a bit unsure about this patch. I accept the unique test is
>> What do others think?
Btw, that has been possible since Python 2.3 with a "# coding = " magic
comment. What's new is that Python 3 assumes UTF-8 by default instead of
ASCII and that you can use Unicode even in variable names.