Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'third- party': 0.04; 'encoding': 0.05; 'string.': 0.05; 'subject:Python': 0.06; 'skip:" 60': 0.07; 'variables': 0.07; 'statements': 0.09; 'api': 0.11; 'python': 0.11; 'itself.': 0.14; 'charset': 0.16; 'clear.': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'issue?': 0.16; 'mysql)': 0.16; 'returned,': 0.16; 'subject:issue': 0.16; 'templating': 0.16; 'wrote:': 0.18; 'passing': 0.19; "python's": 0.19; 'code,': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; 'fixed.': 0.24; 'specify': 0.24; 'define': 0.26; 'query': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'said,': 0.30; 'went': 0.31; 'run': 0.32; 'another': 0.32; 'says': 0.33; 'style': 0.33; 'could': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'connection': 0.35; 'problem.': 0.35; 'something': 0.35; 'but': 0.35; 'module.': 0.36; 'doing': 0.36; 'should': 0.36; 'being': 0.38; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'solve': 0.60; 'tell': 0.60; 'subject: ': 0.61; 'course': 0.61; 'email addr:gmail.com': 0.63; 'between': 0.67; 'results': 0.69; 'expose': 0.84; 'differences': 0.93 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Thu, 30 May 2013 03:29:56 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Encodign issue in Python 3.3.1 (once again) References: <7823093c-2c07-4fa0-ae97-960c62f8ff9d@googlegroups.com> <69f5q8hkra42rvpfmbng4f0airgikqf5js@4ax.com> <9560d43f-8100-4914-9a71-c30ab479ec35@googlegroups.com> <0e3ef4e1-800f-40fc-8cdb-f9d1467266b0@googlegroups.com> <2217da95-178b-4af1-b816-af3ac5cb5f07@googlegroups.com> <332e8acf-7484-49ba-b2e9-5861a001c2e6@googlegroups.com> <65dff60d-5b85-47ab-8f9b-f5578998e807@googlegroups.com> In-Reply-To: <65dff60d-5b85-47ab-8f9b-f5578998e807@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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369906211 news.xs4all.nl 15986 [2001:888:2000:d::a6]:55107 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46446 On 05/29/2013 04:30 AM, nagia.retsina@gmail.com wrote: > What makes us o sure it is a pymysql issue and not python's encoding > issue? The original traceback, which showed that the encoding error was happening in "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108. As was said, you solve that by passing a charset="utf-8" to the connection string. So doing that solved the encoding problem (a query is now being successfully built and sent to mysql) and went on to expose another problem (bug) in your code, but I cannot tell what that is, since the error happened in a subprocess and the traceback got sent to /dev/null. I suspect is has something to do with how the query results are being returned, or it could have something to do with the query itself. Python DB API does not specify exactly which style of prepared statements should be used by a given third-party module. So differences in syntax between how pymysql and MysqlDB define the variables could be the problem. In any case your course is clear. Run pelatologio.py outside of your templating system and see what the traceback says exactly now that the charset issue is fixed.