-
Notifications
You must be signed in to change notification settings - Fork 29
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
Bug encountered during accessing local Wiki #79
Comments
Strange, I don't have a local instantiation of a media wiki anymore, but have you confirmed that the api url that you used loads the api page? If not, it could be that there was a change to the API since the last time I looked at this project that would cause that issue. |
I am also seeing this error on a production wiki on 1.31 LTS. I've tracked it down the response the wiki is giving and it seems that the wiki it is a permissions error. The init and set_api_url functions will request api info from the wiki. However, for wikis that require login for all actions this won't work since you aren't logged in. Unfortunately it doesn't look like this library provides a way to do the login before it attempts to make this request. I was able to hack a quick way to do it and got it working for me locally, but I think fixing it in this library will take a bit more work. Here is the response from my wiki for reference: |
This is interesting; would you be willing to show me what type of hack you pulled together to make it so you login before accessing the wiki? Most likely, we would want to add username/password as potential parameters to the wiki object initialization and use the presence of those to log into the wiki. Thoughts? |
I just made the quickest change I could see that would potentially allow me to try out using the library. I moved the As far as fixes, yeah I think adding login info as an option to the initialization, and making sure to login before making any other calls would work. The login and set_api_url would still not work. Perhaps an overloaded set_api_url that accepts a username and password to then login and set the url in the right order. |
@jtmullen would you be willing to try using the following branch? I believe I made it possible to login during initialization but I do not have a mediawiki site to test against. @jkpubsrc does this seem to be analogous to the issue you ran into? Was your local wiki requiring login to access the API? |
@barrust was just able to give it a try, seems to work perfectly! I did try both passing in the url, username, and password at initialization and via |
Wonderful! I released a new version and uploaded to pypi! @jkpubsrc if this didn't resolve your issue, please reopen this ticket. |
Wiki is valid, works perfectly, API is enabled. The Wiki version is quite recent: 1.33.0
Hm, so what do do now?
The text was updated successfully, but these errors were encountered: