Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'say,': 0.05; '(b)': 0.07; 'variables': 0.07; 'cookie': 0.09; 'anyway': 0.14; 'block.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'set,': 0.16; 'subject:issue': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'first.': 0.19; 'examples': 0.20; '(a)': 0.24; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'host': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'exceptions': 0.31; 'header,': 0.31; 'sep': 0.31; 'problem': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'course': 0.61; "you're": 0.61; 'first': 0.61; 'making': 0.63; 'here': 0.66; 'study': 0.69; 'coffee': 0.84; 'also...': 0.91; 'drink': 0.93; 'tied': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Jo7LAptIdebLhgvxwMGpVcgEK4+7bMU3xai6Z5uqaSI=; b=Et8VtbPEVh0TltM/pk/2/c3KjN/yXnSvPsEcBYFKsssilhZUKgSxNTtJeL0Z4eG2Eu T+sriyn3VqOZL7lVEYqiET/ILh2lZ+f5tIJ3yNziRqsfrYGaqI3wgDwhWn6jsVRS//sm 99EfTIqwQnwW/rsX/CYhhMd2XTE938e0cABp41qvqSayzll097gOSLHWehUGLAq0DHrz CV4/s2rID/5gvWi3FaWl+gypmo1fgZrhsVCppFgSAxbxQ4MDiFzepkaNcTEMuR9F98Ay oD2ZSVoeH4BjyqcAO+VvALq9Rdn5NSa3PBhpwRYQqiSRYV7x9IM21J1QoY+CH9TzI9qq oaFg== MIME-Version: 1.0 X-Received: by 10.52.165.45 with SMTP id yv13mr13530406vdb.1.1378019566007; Sun, 01 Sep 2013 00:12:46 -0700 (PDT) In-Reply-To: References: Date: Sun, 1 Sep 2013 17:12:45 +1000 Subject: Re: UnicodeDecodeError issue From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378019568 news.xs4all.nl 15881 [2001:888:2000:d::a6]:38497 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53401 On Sun, Sep 1, 2013 at 4:50 PM, Ferrous Cranus wrote: > Ye i'm aware that i need to define variables before i try to make use of them. > I have study all of your examples and then re-view my code and i can *assure* you that the line statement that tied to set the 'host' variable is very early at the top of the script(of course after imports), and the cur.execute comes after. > > The problem here is not what you say, that i try to drink k a coffee before actually making one first but rather than i cannot drink the coffee although i know *i have tried* to make one first. > > > i will upload the code for you to prove my sayings at pastebin. > > http://pastebin.com/J97guApQ You're setting host inside a try/except block. Are you getting exceptions that prevent it from being set, perhaps? Also... do you seriously (a) block access if no Referer: header, and (b) permit that access anyway if the user has a non-blank cookie named 'admin'? Seriously?? ChrisA