#34492: I get an error when using BinaryField in sqllite3.
-------------------------------------+-------------------------------------
               Reporter:  Taikono-   |          Owner:  nobody
  Himazin                            |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  3.2
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  BinaryField
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I'm working with data in Blobs in sqlite. It is purely binary (like an
 image for example) and not information that can be converted to a string.
 When I get that data through django's model, I get the following error:


 {{{
   File "\site-packages\django\db\models\query.py", line 674, in first
     for obj in (self if self.ordered else self.order_by('pk'))[:1]:
   File "\site-packages\django\db\models\query.py", line 280, in __iter__
     self._fetch_all()
   File "\site-packages\django\db\models\query.py", line 1324, in
 _fetch_all
     self._result_cache = list(self._iterable_class(self))
   File "\site-packages\django\db\models\query.py", line 51, in __iter__
     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch,
 chunk_size=self.chunk_size)
   File "\site-packages\django\db\models\sql\compiler.py", line 1175, in
 execute_sql
     cursor.execute(sql, params)
   File "\site-packages\django\db\backends\utils.py", line 98, in execute
     return super().execute(sql, params)
   File "\site-packages\django\db\backends\utils.py", line 66, in execute
     return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
   File "\site-packages\django\db\backends\utils.py", line 75, in
 _execute_with_wrappers
     return executor(sql, params, many, context)
   File "\site-packages\django\db\backends\utils.py", line 84, in _execute
     return self.cursor.execute(sql, params)
   File "\site-packages\django\db\utils.py", line 90, in __exit__
     raise dj_exc_value.with_traceback(traceback) from exc_value
   File "\site-packages\django\db\backends\utils.py", line 84, in _execute
     return self.cursor.execute(sql, params)
   File "\site-packages\django\db\backends\sqlite3\base.py", line 423, in
 execute
     return Database.Cursor.execute(self, query, params)
 django.db.utils.OperationalError: Could not decode to UTF-8 column
 'msrepl_synctran_ts' with text ''
 }}}


 I researched quite a bit about this, but there wasn't much information on
 the internet.
 Please suggest me a workaround. I'm sorry I can't handle this with python.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34492>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701877e89aab4-3b248746-6d13-47c9-864e-0d28fdb56dc2-000000%40eu-central-1.amazonses.com.

Reply via email to