-
Notifications
You must be signed in to change notification settings - Fork 169
Description
Hi, I started receiving a ValueError a few weeks ago after upgrading django-mailbox to 4.8.2 (django is 2.2.27). the DB is postgres which prevents string from been created from a NUL character. a empty string should be passed in this case.
ValueError: A string literal cannot contain NUL (0x00) characters.
Here is the full trace and I can also provide examples of the messages that are causing this error. It is a recurring problem that is causing considerable issues to our webapp so would appreciate if this could be looked at urgently - many thanks!
Traceback (most recent call last):
File "manage.py", line 16, in
execute_from_command_line(sys.argv)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django_mailbox/management/commands/getmail.py", line 25, in handle
for message in messages:
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django_mailbox/models.py", line 424, in get_new_mail
msg = self.process_incoming_message(message)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django_mailbox/models.py", line 240, in process_incoming_message
msg = self._process_message(message)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django_mailbox/models.py", line 378, in _process_message
msg.save()
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/base.py", line 744, in save
force_update=force_update, update_fields=update_fields)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/base.py", line 782, in save_base
force_update, using, update_fields,
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/base.py", line 873, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/base.py", line 911, in _do_insert
using=using, raw=raw)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/query.py", line 1186, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1377, in execute_sql
cursor.execute(sql, params)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/crr/.virtualenvs/forum/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
ValueError: A string literal cannot contain NUL (0x00) characters.