wikiteam icon indicating copy to clipboard operation
wikiteam copied to clipboard

IOError: [Errno 2] on dumpgenerator with image filename containing /

Open emijrp opened this issue 10 years ago • 7 comments

From [email protected] on January 27, 2014 21:09:34

I am using dumpgenerator revision r882 on windows 7 and I am getting the following error: Traceback (most recent call last): File "dumpgenerator.py", line 1220, in main() File "dumpgenerator.py", line 1211, in main resumePreviousDump(config=config, other=other) File "dumpgenerator.py", line 1127, in resumePreviousDump generateImageDump(config=config, other=other, images=images, start=lastfilename2) # we resume from previous image, which may be corrupted (or missing .desc) by the previous session ctrl-c or abort File "dumpgenerator.py", line 673, in generateImageDump urllib.urlretrieve(url=url, filename='%s/%s' % (imagepath, filename2) ) File "C:\Python27\lib\urllib.py", line 94, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "C:\Python27\lib\urllib.py", line 244, in retrieve tfp = open(filename, 'wb') IOError: [Errno 2] No such file or directory: './norunescapewikiacom-20140127-wikidump/images/Engelsk/Norsk.png'

Attachment: errno2.png

Original issue: http://code.google.com/p/wikiteam/issues/detail?id=86

emijrp avatar Jun 25 '14 10:06 emijrp

From [email protected] on January 31, 2014 07:01:34

Another Wikia wiki... I wonder if this is the same as issue 81 . Ah, no, it's probably that slash in the filename. Does someone know how to handle Windows?

Summary: IOError: [Errno 2] on dumpgenerator with image filename containing / (was: IOError: [Errno 2] on dumpgenerator)
Labels: OpSys-Windows

emijrp avatar Jun 25 '14 10:06 emijrp

From [email protected] on January 31, 2014 07:25:36

Issue 63 has been merged into this issue.

emijrp avatar Jun 25 '14 10:06 emijrp

From [email protected] on January 31, 2014 07:28:57

Blockedon: wikiteam:73

emijrp avatar Jun 25 '14 10:06 emijrp

Would just truncating or replacing with _ and adding the hash be sufficient?

PiRSquared17 avatar Sep 24 '14 04:09 PiRSquared17

Would just truncating or replacing with _ and adding the hash be sufficient?

Truncation should already be handled. If the slash works outside Windows I'd avoid additional sanitisation for everyone, though.

nemobis avatar Sep 24 '14 05:09 nemobis

/ is the one character not allowed in filenames on Linux. Has this really been open for over a year now? I ran into this issue today so I made a pull request: https://github.com/WikiTeam/wikiteam/pull/249. Sorry if it overlooks some earlier fix.

rsomeon avatar Aug 10 '15 21:08 rsomeon

I don't know why this weird bug is still a thing, but you can work around it by cd'ing a directory up and choosing the directory you were just in through the path argument or whatever other things you were using.

Slider-Whistle avatar Oct 09 '19 19:10 Slider-Whistle