-
Notifications
You must be signed in to change notification settings - Fork 152
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
Using dumpgenerator.py with Python 3 #395
Comments
EndeavourAccuracy, 29/09/20 18:30:
can no longer access this because it relies on Ubuntu repos.
I'm not sure what you mean. Does Mint no longer carry pip?
|
For efficiently working with legacy versions of Python, it is recommended to use venv or (my personal preference) miniconda. Miniconda creates 'environments' which can contain any version of (for instance) python without affecting system python. You can download miniconda: After restarting your shell window or ssh session. you you can create a new conda environment 'wiki' This python version 2.7 is only accessible from within the conda environment 'wiki' and does not affect the system files. The binaries are stored in your home directory, and none of this requires root access as you are not changing system files. |
I was caught with this because Mint 20 does not have python2 or pip by default. It seems overkill to install them both use to get dumpgenerator.py working. Why cannot it be upgraded to a modern version? |
@EndeavourAccuracy do you have your modifications available somewhere to work against? So we could try to fix the errors you were running into? |
Not any more, no. Part of my reasoning not to keep it was that I'm not a Python programmer, and I might therefore have accidentally introduced - perhaps hard to spot - errors in the code. |
I tried following the instructions in the main README on both macOS 11 and Debian 11, and in both cases it gave me the following: $ ./dumpgenerator.py --help
Please install the kitchen module.
Please install or update the Requests module. ...even after running Anyway, I'm muddling my way through @OAHOR's instructions for |
I hope this ticket won't be closed referencing a work-around to get Python 2 working on modern systems. |
Here's a basic manual for creating backups without shell access, and without using dumpgenerator.py.
|
I just made it so that my existing pull request doesn’t auto-close this issue. I’m working on a Python 3 version right now. |
Can all y’all give #409 a spin? Thanks! |
Personally, I've just moved to another method. I also lack the time to test-run the updated script, sorry. If this would've come just a bit earlier, I might have made different choices. I've been a bit surprised that so few users have made themselves heard here, even though this ticket has been open since September 2020. I'm guessing most MediaWiki admins have, and use, shell access for backups. |
That’s fine. I’ve since figured out how to run the CI tests locally, so I can do most of my testing myself. |
I tried your version for Python3 without luck unfortunately, trying to download the Vim Wikia I get this error.
% python dumpgenerator.py https://vim.fandom.com/wiki/Vim_Tips_Wiki --xml --images Welcome to DumpGenerator 0.4.0-alpha by WikiTeam (GPL v3)More info at: https://github.com/WikiTeam/wikiteamAnalysing https://vim.fandom.com/api.php |
Thanks. Could you pull the new changes and try it again? I didn’t finish the full dump myself, but it looks kind of like it should be working now. (As in, I think the problems I’m having at this point might be limited to the test script.) FYI, to run, do the following: $ pip install pipenv
$ pipenv run python dumpgenerator.py ... Also, FYI, it’s easier to read if you wrap the output in three “tick” signs, like so:
|
Even after successfully installing pipenv, when I try running the script (with pipenv run ...) I get asked once again to install pipenv. Am I missing something? It looks like a dump was started and then immediately aborted, though. It created the folder and the confix.txt file. |
It seems like the script is still relatively fussy. I was able to get this specific command to run on macOS: % pipenv run python dumpgenerator.py https://vim.fandom.com/wiki/Vim_Tips_Wiki --xml --images By contrast, the Wikiteam wiki wouldn’t download. For testing purposes, could you try exactly the same command with the Vim Wikia?
Can you try the instructions in the
Also, please include what system you’re running, as well as the output of the commands
Weird. I mean, I’ve gotten failed dumps, too, but if |
Oh, and also the output of |
In a jail on FreeBSD 11.4-RELEASE-p9 amd64:
At first I had issues because I thought it was necessary to install poetry and wikiteams3 using pip, then the new dumpgenerator.py by itself. That didn't work out so well. It led to the error above, which I tried adding exception logging to and I got this:
This was confusing because even when I installed mwclient via pip, it didn't work. I also had to use Once I actually cloned the whole repo and checked out python3, it worked more smoothly, except that it broke when saving files:
My understanding of this is that "wb" worked when writing strings in 2.x but won't in 3.x because they're now Unicode. Instead, it has to be opened as "w" - anyway, I made the following change and it worked:
This appeared to fix |
Hi @GreenReaper it’s been a month or two since I last worked on this, so it may take me a little bit to catch up with what’s going on here. Thank you for the detailed information, though! |
any news on it ?
|
Hi @ImmoWetzel—if you pop over to the pull request at #409, the instructions for how to use the (still somewhat incomplete) Python 3 port are a bit more up-to-date there. I’ve added installation instructions at the top of the thread so you don’t have to read all the way through just to use the mostly working version of Headline to grab people’s attention as necessary: To use
|
Makes very little sense, since you, in 2022, usually have shell access to a server if you have FTP or SQL access. |
Up to you. We also have some slightly different approaches on which one could choose to base any further work: |
@OAHOR `Please install the kitchen module. (wiki) C:\Users\karti>python --version` |
@kwekewk I'm not exactly sure where you're running into problems, but I made a tidy version of the instructions for using miniconda for a pull request if you'd like to give them a try. (They're basically just @OAHOR's instructions, though.) As an alternative, you can try the mostly functional Python 3 port I've been working on. There are other people helping me with the port, as well, so if you run into difficulties with it, you can feel free to open an Issue on that repository, and one or more of us can take a look. |
@elsiehupp solved, apparently I had to repeat the command requirements in conda pip install --user --upgrade -r requirements.txt . And, why the downloader can only download 40-50 images per minute? |
The delay functionality exists to help avoid getting temporarily blocked by a remote server for sending too many requests too quickly. You should be able to specify the delay in seconds with a parameter. (You can get a list of available parameters with the Obviously you shouldn't need the delay functionality if you're running the script locally, but if you're running the script locally you should also be able to initiate an export from within the MediaWiki admin interface itself. |
Python is currently at version 3.8.6 and your code requires 2.7.
As of 23 April, Ubuntu (Focal Fossa; 20.04) repos no longer carry kitchen for Python 2; only python3-kitchen.
Similarly, as of 27 June, Mint (Ulyana; 20) can no longer access this because it relies on Ubuntu repos.
As a result, modern distros can no longer use dumpgenerator.py.
I'm not a Python programmer.
Nevertheless, I've tried converting dumpgenerator.py from Python 2 to Python 3.
This attempt was unsuccessful.
I've:
But then I ran into this error, and I could not continue:
"RecursionError: maximum recursion depth exceeded while calling a Python object"
Also, I have my own (C and PHP/JavaScript) FOSS programming projects to work on.
Can you folks work on making a version of dumpgenerator.py that works with Python 3?
The text was updated successfully, but these errors were encountered: