try:
session.add(row)
session.flush()
- except IntegrityError as e:
+ except IntegrityError, e:
failed_rows.append(row)
# Loop over the failed rows and keep trying to insert them. If a loop
# Success!
del failed_rows[i]
do_another_loop = True
- except IntegrityError as e:
+ except IntegrityError, e:
pass
if failed_rows:
csvexport {uri} [dir] Export data from the database given by the URI
to a set of CSVs.
Directory defaults to cwd.
-"""
+""".encode(sys.getdefaultencoding(), 'replace')
sys.exit(0)