https://github.com/alexz-enwp/wikitools/issues/40 was reported as a bug for the wikitools library. However, the problem appears to be in MediaWiki.
When trying to do an API edit containing the character য়, MD5 verification fails. This is because MediaWiki is decomposing this single character into 2 characters, য+ ়. The latter is a combining character, so the end result will look the same - য় - but it is 2 different characters when calculating the md5 hash, and does not match the hash of what the client sent.
So md5( "য়" ) -> 29a76e95913204ab68f10a1c34784a7c
And md5( "য়" ) -> 1bb92266e7298fb3aa4aa5c641562f10
I've verified that Python is sending a single character in the POST data, and PHP has a single character in the $_POST variable, so the decomposition is done in MediaWiki somewhere. It's easy enough to work around by just not using MD5 verification with Bengali text, but it seems like unexpected behavior.
I've also verified this is the case with other precomposed Bengali characters such as ড়, but is not the case with precomposed characters from other scripts such as ў.
Simple replication code:
# -*- coding: utf-8 -*- from wikitools import * site = wiki.Wiki('http://localhost/w/api.php') p = page.Page(site, 'Test 123') p.edit(text= 'য়')
This fails with a "badmd5" error.