Bugs item #1531489, was opened at 2006-07-30 22:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1531489&group_id=61702

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.0.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Winkler (slinkp)
Assigned to: Nobody/Anonymous (nobody)
Summary: sb_dbexpimp.py can't import: _csv.Error: newlline inside str

Initial Comment:
Version info: 1.0.4 on gentoo linux,  python 2.4.3,
db 4.2.52_p2-r1.

I was trying to copy a db to a system where I'm not
root and which seems to have an older version of
berkely db (at least, that's what I guess from
"bsddb._db.DBInvalidArgError: (22, 'Invalid argument --
/home/paul/.spambayes/hammie.db: unsupported hash
version: 8'"

Reading the FAQ, I figured export/import via
sb_dbexpimp.py might work.  Export ran fine.
Trying to import from the flat file gave me this error:

Importing file tmp/foo.flat into database tmp/new2.db
Traceback (most recent call last):
  File "/usr/bin/sb_dbexpimp.py", line 278, in ?
    runImport(dbFN, useDBM, newDBM, flatFN)
  File "/usr/bin/sb_dbexpimp.py", line 211, in runImport
    for (word, hamcount, spamcount) in rdr:
_csv.Error: newline inside string


I hacked sb_dbexpimp to print each word, so I could
find the one before the barf. From this I discovered
that all the problematic lines in the flat file looked
like:

'content-disposition:attachment;\r\tfilename="03360011.jpg"'

... with varying filenames.  (I was unable to find the
messages that contained these lines; apparently they
were long-discarded spam).

A workaround is to ignore words that contain the
carriage return character. Patch attached.

Having done this, I can re-run the export, rsync the
flat file to the other box, and now i can import it
there without complaints. And then spambayes works on
the remote box with the new db. Yay!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1531489&group_id=61702
_______________________________________________
Spambayes-bugs mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-bugs

Reply via email to