#260 Fails in col.py if DBMS does not specify encoding

closed-fixed
General (125)
5
2010-01-06
2010-01-02
Anonymous
No

If the DBMS does not have an encoding specified then SQLObject fails in col.py complaining that the 2nd parameter must be a string not None. This situation could easily exist in databases migrated from MySQL 3.x.

The solution seems to be to add a test in the 'from_python' method of StringValidator'. I put it after the call to getattr.
if dbEncoding == None:
dbEncoding = 'ascii'

Code was added via SQLObject-0.12.0-py2.6.egg

Discussion

  • Oleg Broytman

    Oleg Broytman - 2010-01-06

    Fixed in the revisions 4069-4071 in the form
    dbEncoding = getattr(connection, "dbEncoding") or "ascii"

     
  • Oleg Broytman

    Oleg Broytman - 2010-01-06
    • labels: 519512 --> General
    • assigned_to: nobody --> phd
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks