encoding/decoding issue with python2.5 and pymssql

Rob Williscroft rtw at freenet.co.uk
Mon Mar 24 16:37:18 EDT 2008


Tzury Bar Yochay wrote in news:3a6c32fe-e7c1-4230-882d-efb3415196c1
@b1g2000hsg.googlegroups.com in comp.lang.python:

> for example:
> the value
> 'EE604EE3-4AB0-4EE7-AF4D-018124393CD7'
> is represent as
> '\xe3N`\xee\xb0J\xe7N\xafM\x01\x81$9<\xd7'
> 

from uuid import *

u = UUID( bytes = '\xe3N`\xee\xb0J\xe7N\xafM\x01\x81$9<\xd7')
print u

u = UUID( bytes_le = '\xe3N`\xee\xb0J\xe7N\xafM\x01\x81$9<\xd7')
print u

The "bytes_le" version prints: ee604ee3-4ab0-4ee7-af4d-018124393cd7
so I guess, this is what mysql is returning.

http://docs.python.org/lib/module-uuid.html

Rob.
-- 
http://www.victim-prime.dsl.pipex.com/



More information about the Python-list mailing list