Re: mysqlIndexerTest.test_unicode fails for me

Joseph Myers <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
On Thu, 30 Apr 2020, Ralf Schlatterbeck wrote:

> In roundup/backends/back_mysql.py we had a condition on python version
> >2 for supplying the charset (utf-8) argument when creating a mysql
> connection. I've changed this to an unconditional initialization. Works

That condition was so that a database created with older Roundup, with 
Python 2, continues to work properly with newer Roundup, with Python 2.  
(I couldn't get such a database to work with Python 3, hence the 
documentation of needing to export and import when moving to Python 3 with 
MySQL.)

The key thing to test is: create a database with older Roundup (e.g. 1.6) 
with Python 2 and MySQL (on a default MySQL installation, so with the 
latin1 default).  Create items in the database with string fields stored 
in the database (issue title, etc.) that contain Unicode characters that 
cannot be represented in latin1 (this works fine - the individual bytes of 
the UTF-8 representation are stored as if they were latin1 characters).  
Then try using that database with Roundup with your change, still with 
Python 2, and make sure that the Unicode characters previously put in 
those string fields still appear correctly (my expectation is that they 
won't, because MySQL will try to translate from latin1 to UTF-8).

-- 
Joseph S. Myers
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.