Import failure with very long fields

Stanislav's Avatar

Stanislav

14 Apr, 2013 04:58 PM

When trying to import a big text file with cards ("back" field contains a log of html for each card) got this error:

Import failed.
Traceback (most recent call last):
File "/usr/share/anki/aqt/importing.py", line 156, in doImport self.importer.run()
File "/usr/share/anki/anki/importing/noteimp.py", line 61, in run c = self.foreignNotes()
File "/usr/share/anki/anki/importing/csvfile.py", line 34, in foreignNotes for row in reader: Error: field larger than field limit (131072)

the fix is rather trivial - set a larger limit in file importing/csvfile.py

import codecs, csv, sys, re
...

csv.field_size_limit(sys.maxsize)

  1. Support Staff 1 Posted by Damien Elmes on 15 Apr, 2013 12:40 PM

    Damien Elmes's Avatar

    thanks for the heads up; I'll look at including this in the near future

  2. Damien Elmes closed this discussion on 15 Apr, 2013 12:40 PM.

  3. Support Staff 2 Posted by Damien Elmes on 14 May, 2013 09:44 AM

    Damien Elmes's Avatar

    I've had another think about this and I'm not sure it's wise to increase the limit, as it will lead to very low searches and could slow down card rendering as well. I've fixed Anki so it won't generate a stacktrace however.

  4. Damien Elmes closed this discussion on 14 May, 2013 09:44 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac