levitation icon indicating copy to clipboard operation
levitation copied to clipboard

integer out of range for 'L' format code

Open plaa opened this issue 13 years ago • 1 comments

I'm trying to convert the wiki at http://sourceforge.net/apps/mediawiki/openrocket/index.php?title=Main_Page

After dumping all the pages and trying to convert, I get the following error:

$ ./import.py < openrocket-20121012122604.xml  > dump
Traceback (most recent call last):
  File "./import.py", line 572, in <module>
    LevitationImport()
  File "./import.py", line 532, in __init__
    BlobWriter(meta).parse(parser)
  File "./import.py", line 306, in parse
    self.parser.run(sys.stdin)
  File "./import.py", line 271, in run
    self.expat.ParseFile(what)
  File "./import.py", line 260, in end
    self.writer.endElement(name)
  File "./import.py", line 342, in endElement
    self.runHandler(name, False)
  File "./import.py", line 323, in runHandler
    return self.handler(name, attrs)
  File "./import.py", line 426, in in_revision
    self.page.addRevision(self.captureGet())
  File "./import.py", line 238, in addRevision
    r.dump()
  File "./import.py", line 208, in dump
    self.meta['meta'].write(self.id, self.timestamp, self.page, self.user, self.minor)
  File "./import.py", line 94, in write
    flags
struct.error: integer out of range for 'L' format code

I tried checking the code, but not being familiar with Python I can't make out what's going wrong. Any help is appreciated. The data dump is at http://sampo.kapsi.fi/tmp/openrocket-20121012122604.xml.bz2

I was also unable to run the script without creating an empty "config.py" file in the directory, the "import config" was failing otherwise. Don't know if that's got something to do with it.

On a side note, how could attachments be migrated? I was surprised there was no mention in the README.

plaa avatar Oct 12 '12 12:10 plaa

Adding debugging before 'pack' reveals that author.id is -1, which cannot be placed into an unsigned long:

rev:1 time:1219080644 page:1 authorid:-1 flags:2

When I changed 'L' to 'l' it just broke later on in a more mysterious place. What should author.id=-1 mean and how should it be handled? It seems from the code that if the script can't parse the user the id is set to -1.

plaa avatar Oct 12 '12 13:10 plaa