-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to fix "The supplied MD5 hash was incorrect" error? #40
Comments
What code are you using? The "edit" method in |
The code we use is here Will check the fix and share the results soon. |
Using skipmd5 will work around the problem here. I don't think this is a problem with wikitools. It looks like a bug with MediaWiki. The issue is the character য়. Python/wikitools is correctly encoding it as e0a79f. But by the time it gets to the MD5 check in the MW API, it's been converted to য+ ়, which is equivalent but is 2 separate characters, e0a6af+e0a6bc and will hash differently. It looks like it's correctly encoded in the PHP $_POST variable, so the problem is in MediaWiki somewhere. Filed upstream - https://phabricator.wikimedia.org/T144071 |
The change made in 8f7a4f2 should fix this issue. |
Getting the following error while uploading a PDF file to https://commons.wikimedia.org
Logged in.
Uploading the file পদ্মাপুরাণ - নারায়ণ দেব.pdf
Traceback (most recent call last):
File "local.py", line 140, in
upload_pdf_file(pdf_file)
File "local.py", line 132, in upload_pdf_file
page.edit(text=wikidata)
File "/usr/local/lib/python2.7/dist-packages/wikitools/page.py", line 623, in edit
result = req.query()
File "/usr/local/lib/python2.7/dist-packages/wikitools/api.py", line 165, in query
raise APIError(data['error']['code'], data['error']['info'])
wikitools.api.APIError: (u'badmd5', u'The supplied MD5 hash was incorrect')
It is reported here
tshrinivasan/tools-for-wiki#17
What may the reason for this?
How can we solve this?
The text was updated successfully, but these errors were encountered: