Hi,

Ok, I've looked into this a bit more and the value is unicode because it 
is returned from columnsFromSchema in mssqlconnection. Changing line 216 
from
            kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
to
            kw['name'] = 
str(soClass.sqlmeta.style.dbColumnToPythonAttr(field))
also fixed the problem.

I'm not quite sure where to go from here. SQL Server 2005 does support 
identifiers with unicode characters (I just created a table with a 
column name that includes hebrew characters). However, I guess it would 
be a big job to make SQLObject support this, and it is not important for 
me at the moment. As a bug fix for now, we can just convert name to a 
string, and possibly dbName as well. I think using the default encoding 
is appropriate; it will cause a UnicodeEncodeError if any unicode 
characters are fixed, which seems reasonable.

So Oleg, if that sounds good to you, shall I submit an alternative patch?

Thanks for your quick response,

Paul


Oleg Broytmann wrote:

>On Mon, Dec 11, 2006 at 05:46:11PM +0000, Paul Johnston wrote:
>  
>
>>I've just submitted a patch (request ID 1613369) with a simple bug fix 
>>that means "tg-admin sql status" now works for me. I am using the MSSQL 
>>backend.
>>    
>>
>
>   The patch is incorrect. First, where from sqlIdentifier() got unicode?
>SQL identifiers certainly must be strings.
>   Second, there is no "basestring" in Python 2.2, and SQLObject still
>supports Python 2.2.
>
>Oleg.
>  
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to