alvra / django-spotnet

A Django app to manage and download posts from Spotnet.
GNU General Public License v3.0
7 stars 6 forks source link

update_spotnet error "Incorrect string value" #13

Open hagst opened 11 years ago

hagst commented 11 years ago
Added post <jqasqOEWMFEeK7YUAYVax@spot.net>
Traceback (most recent call last):
  File "\example_project\manage.py", line 8, in <module>
    execute_from_command_line(sys.argv)
  File "\django\core\management\__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "\django\core\management\__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "\django\core\management\base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "\django\core\management\base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "\spotnet\management\commands\update_spotnet.py", line 42, in handle
    conn.update(overwrite, self.logger_function)
  File "\spotnet\connection.py", line 140, in update
    self.update_group(group, overwrite=overwrite, logger=lambda x: logger('  %s' % x))
  File "\spotnet\connection.py", line 179, in update_group
    logger=lambda x: logger('  %s' % x),
  File "\spotnet\connection.py", line 225, in update_group_postnumbers
    logger=lambda x: logger('  %s' % x),
  File "\django\db\transaction.py", line 209, in inner
    return func(*args, **kwargs)
  File "\spotnet\connection.py", line 333, in add_post
    snp.save()
  File "\django\db\models\base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "\django\db\models\base.py", line 551, in save_base
    result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  File "\django\db\models\manager.py", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "\django\db\models\query.py", line 1593, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "\django\db\models\sql\compiler.py", line 910, in execute_sql
    cursor.execute(sql, params)
  File "\django\db\backends\util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "\django\db\backends\mysql\base.py", line 114, in execute
    return self.cursor.execute(query, args)
  File "\MySQLdb\cursors.py", line 203, in execute
    if not self._defer_warnings: self._warning_check()
  File "\MySQLdb\cursors.py", line 117, in _warning_check
    warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Incorrect string value: '\xF0\x9F\x9A\x8F S...' for column 'description' at row 1

Converting the colomn "description" from "utf8_unicode_ci" to "utf8_general_ci" doesn't fix the problem.

Suggested solution: Change the column encoding from utf8 to utf8mb4 source Applied: Converting the colomn "description" from "utf8_general_ci" to "utf8mb4_unicode_ci" Result: Warning: Incorrect string value: '\xF0\x9F\x9A\x8F S...' for column 'description' at row 1

This is probably my last ticket because i am running out of servers usable for updating Django-Spotnet.