← Syamjith NK

8 September 2026 · Syamjith NK

3,168 files use the broken Arabic recipe. Most of them are fine.

Searching GitHub for get_display arabic_reshaper.reshape language:python returns 3,168 files. On matplotlib 3.11 and on Pillow built with Raqm, that recipe reverses your text. It would be easy to conclude there are three thousand broken projects out there and start filing.

That conclusion is wrong, and the reason it is wrong is the only interesting thing here.

The recipe is not a bug. Doing it twice is.

arabic_reshaper.reshape() converts Arabic to presentation forms. get_display() puts the string into visual order. Together they do the work a text engine would do, which is exactly right if the thing that draws your text does not do it for you, and exactly wrong if it does.

renderershapes and reorders?the recipe is
matplotlib ≥ 3.11yesa bug
matplotlib < 3.11norequired
Pillow built with Raqmyesa bug
Pillow without Raqmnorequired
ReportLab, fpdfnorequired
print() to a terminalterminal-dependentnot mine to judge

So the search result is not a list of bugs. It is a list of places where somebody has to look at what happens next.

I looked at six

Ranked by stars and recency, then read rather than pattern-matched. Three were genuinely broken:

Three were not:

Two of the six matched the search and were fine. One matched, and the matching code does not execute. If I had filed on all six I would have been wrong half the time, and being wrong in public on someone else’s repository is expensive in a way that being quiet is not.

What a useful checker has to do

I put this into arabic-lint 0.2.0, and writing it taught me more than the search did. Every one of these came from testing against the six real files rather than snippets I made up:

The tool now stays silent on all three of the projects that are fine, and flags all three that are not.

The part worth keeping

A grep gives you 3,168 results and no judgement. The judgement is the work, and most of it is deciding what not to report. A checker that flagged all 3,168 would be switched off within a day, and rightly.

The same is true of the search itself. Three thousand hits is not three thousand bugs; it is a population, and the interesting question is what fraction of it is actually broken. On a sample of six, it was half.