#13758: MySQLdb utf8_bin and django causes UnicodeDecodeError
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  sam.vevang@…                       |         Status:  new
                   Type:  Bug        |      Component:  Database layer
              Milestone:             |  (models, ORM)
                Version:  SVN        |       Severity:  Normal
             Resolution:             |       Keywords:  utf8_binMySQLdb
           Triage Stage:  Accepted   |  collation unicode bytestring
    Needs documentation:  0          |      Has patch:  1
Patch needs improvement:  0          |    Needs tests:  1
                                     |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by graham_king):

 * version:  1.2 => SVN
 * easy:   => 0


Comment:

 I can't reproduce this.

 Using this model (in app 'backends'):

 {{{
 import tempfile
 from django.core.files.storage import FileSystemStorage

 temp_storage_location = tempfile.mkdtemp()
 temp_storage = FileSystemStorage(location=temp_storage_location)

 class Person(models.Model):
     name = models.CharField(max_length=20)
     avatar = models.FileField(storage=temp_storage, upload_to='tests',
 max_length=15)
 }}}

 and running this test:

 {{{
 from django.db import connections

 cur = connections['default'].cursor()
 cur.execute('ALTER TABLE backends_person MODIFY avatar VARCHAR(15)
 CHARACTER SET utf8 COLLATE utf8_bin;')
 cur.close()

 Person.objects.create(name='Django', avatar='汉语/漢語.png')

 p = models.Person.objects.all()[0]
 p.delete()
 }}}

 it works. I also tried uploading a UTF8 named file via the admin and
 deleting it, and again it worked.

 Could you post a failing test, or more specific instructions for
 replicating?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13758#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to