-
Notifications
You must be signed in to change notification settings - Fork 149
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
Image dumps fail when an invalid character is present #472
Comments
I'm sorry but Windows isn't an officially supported system on which to
run wikiteam software. Things are going to be easier in GNU/Linux (e.g.
Debian 11), although some are using WSL as well. If you plan to reimport
the wiki elsewhere, it's advisable to use a filesystem similar to the
source and destination servers (unless you plan to fix all files
manually later).
|
I recently ran into the same problem, but you don't need to remove the file from the wiki. |
You can use something like this to sanitize filenames for Windows:
In generateImageDump I added the following:
The logging is done so you will be able to easily access which filenames have been changed. P.S.: I usually don't do Python, so please forgive if I did something unconventional. |
I've tried to download a pretty messy wiki in the hopes to transfer it to Miraheze, but during the dumping process, the very first image failed because characters are present that cannot be used to create a file or folder in Windows, such as question marks or quotation marks.
IOError: [Errno 22] invalid mode ('wb') or filename: u'C:\Users\XXXXX\Desktop\PTW-2/images/3LameStudio what did you do to my boys?.png'
Removing the file from the wiki altogether fixed it.
The text was updated successfully, but these errors were encountered: