Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'subject:Python': 0.06; 'utf-8': 0.07; 'string': 0.09; 'encode': 0.09; 'subject:2.7': 0.09; '(just': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'logger': 0.16; 'sqlite': 0.16; 'unicode.': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'byte': 0.24; 'unicode': 0.24; 'looks': 0.24; 'header:In- Reply-To:1': 0.27; 'probably': 0.32; 'knows': 0.35; "i'll": 0.36; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'manually': 0.60; 'foreign': 0.74; 'difference!': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Sat, 22 Nov 2014 21:58:47 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert References: <5d474a87-e2a5-43d3-b07c-4a1194880b4d@googlegroups.com> In-Reply-To: <5d474a87-e2a5-43d3-b07c-4a1194880b4d@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416718744 news.xs4all.nl 2886 [2001:888:2000:d::a6]:42079 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81328 On 11/22/2014 08:54 PM, llanitedave wrote: Well that DID make a difference! I used the %r marker, and the logger line gave me back: > "INFO:Related borehole_id is u'testbh3', of_borehole is 'testbh3'" > > So it looks like I need to change my foreign key string to a unicode > string. I'll be working on that... Or manually encode it to a UTF-8 byte string (just call .encode() on it). Sqlite probably only knows about UTF-8 when it comes to unicode.