import21 fails with MySQL because mailinglist.info is over 255 character long
In mailman2, the description of a list may be longer than 255 characters. And it fails when imported in the mailinglist.info field in MySQL because it is limited to 255 characters. It works with SQLite.
Here is an example:
sqlalchemy.exc.DataError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (pymysql.err.DataError) (1406, "Data too long for column 'info' at row 1") [SQL: 'UPDATE mailinglist SET created_at=%(created_at)s, next_digest_number=%(next_digest_number)s, digest_last_sent_at=%(digest_last_sent_at)s, volume=%(volume)s, last_post_at=%(last_post_at)s, convert_html_to_plaintext=%(convert_html_to_plaintext)s, forward_unrecognized_bounces_to=%(forward_unrecognized_bounces_to)s, dmarc_mitigate_action=%(dmarc_mitigate_action)s, description=%(description)s, discard_these_nonmembers=%(discard_these_nonmembers)s, first_strip_reply_to=%(first_strip_reply_to)s, info=%(info)s, moderator_password=%(moderator_password)s, preferred_language=%(preferred_language)s, respond_to_post_requests=%(respond_to_post_requests)s, subject_prefix=%(subject_prefix)s WHERE mailinglist.id = %(mailinglist_id)s'] [parameters:
{'created_at': datetime.datetime(2001, 12, 22, 23, 0, 52, 891113), 'next_digest_number': 21, 'digest_last_sent_at': datetime.datetime(2020, 9, 20, 9, 23, 21, 644508), 'volume': 487, 'last_post_at': datetime.datetime(2020, 9, 20, 9, 23, 21, 750535), 'convert_html_to_plaintext': 1, 'forward_unrecognized_bounces_to': 0, 'dmarc_mitigate_action': 1, 'description': 'SPIP : developpement', 'discard_these_nonmembers': b'\x80\x04\x95MP\x00\x00\x00\x00\x00\x00]\x94(\x8c\x18reklama@e-dystrybucja.pl\x94\x8c\x19andre.lefranc@laposte.net\x94\x8c\x1bngouelle@ile-des-medias ... (26458 characters truncated) ... spros.fr\x94\x8c\x1dno.reply@segmentbeast.monster\x94\x8c\x16selvam@madhuoffset.com\x94\x8c\x0ealm@gretopi.re\x94\x8c\x16andreaswang163@163.com\x94e.', 'first_strip_reply_to': 1, 'info': "<b>Attention :</b> cette liste est destinée à discuter de la programmation de SPIP et ses plugins. Le fait que votre problème soit compliqué et impli ... (484 characters truncated) ... de gestion de
bugs</a>. Ainsi votre intervention sera conservée précieusement plutôt que d\x92être noyée dans un flot de messages divers et variés. ", 'moderator_password': b'36675febd7252eef1c20fe7b6e5f438552115177', 'preferred_language': 'fr', 'respond_to_post_requests': 0, 'subject_prefix': '[spip-dev] ', 'mailinglist_id': 3}] (Background on this error at: http://sqlalche.me/e/9h9h)
Edited by Loïc Dachary