<div class="gmail_quote">On Tue, Jan 19, 2010 at 7:50 AM, Gnarlodious <span dir="ltr"><<a href="mailto:gnarlodious@gmail.com">gnarlodious@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I am using Python 3, getting an error from SQLite:<br>
<br>
sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless<br>
you use a text_factory that can interpret 8-bit bytestrings (like<br>
text_factory = str). It is highly recommended that you instead just<br>
switch your application to Unicode strings.<br>
<br>
So... how do I switch to Unicode? I thought I was doing it when I put</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
# coding:utf-8<br>
<br>
at the start of my script.<br></blockquote><div><br></div><div>All that does is mean that the script itself is encoded as utf8.</div><div><br></div><div>In Py3, anything you do "this" or use str(), you are using unicode strings.</div>

<div><br></div><div>The problem appears to be that you are passing bytestrings to sqlite; things created with b"this" or bytes(), or read from a file as bytes and not decoded before passing it to the database. </div>

<div><br></div><div>To really help further, you should provide the line that threw that warning and show where any variables in it come from. As for that error message, I believe it means text_factory = bytes.</div><div>
<br>
</div></div><div name="mailplane_signature">--S</div>