ConfigObj quoting issues

TheSaint fc14301589 at
Tue Jun 3 11:02:43 CEST 2008

On 14:25, martedì 03 giugno 2008 Roopesh wrote:

> This error is because of the presence of \', \", \n etc.
> I had to do the following to make it work.
> address[i].replace("\'",'').replace('\"','').replace('\n','')
it's rather ugly :)
I suggest use re module as follow:

import re
address[i] = re.sub('(`|"|\n)',re.MULTILINE,address[i])

if you've a big chunck of email it'd be fine to compile the regex.

match = re.compile(`|"|\n)
address[i] = match.sub(address[i])

I think there would be a problem with unicode email addresses. But I doubt
the existance of unicode addresses nowadays.
Unsure for the syntax, pls check
                          ^^^ according your version, but they're quite the

Mailsweeper Home :

More information about the Python-list mailing list