Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46312

Re: Encodign issue in Python 3.3.1 (once again)

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <torriem@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'causing': 0.04; 'elif': 0.05; 'output': 0.05; 'subject:Python': 0.06; 'args': 0.07; 'attribute': 0.07; 'exit': 0.09; 'template': 0.14; "'localhost',": 0.16; '(1,': 0.16; '10:45': 0.16; '586': 0.16; 'charset': 0.16; 'cmd': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'retcode': 0.16; 'returncode': 0.16; 'script,': 0.16; 'subject:issue': 0.16; 'template,': 0.16; 'wrote:': 0.18; 'hey': 0.18; 'trying': 0.19; 'basically': 0.19; "skip:' 30": 0.19; 'working.': 0.19; '(the': 0.22; 'command': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'host': 0.29; 'am,': 0.29; 'raise': 0.29; 'returned': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'produces': 0.31; "skip:' 40": 0.31; 'file': 0.32; 'there.': 0.32; 'run': 0.32; 'not.': 0.33; 'problem': 0.35; 'subject: (': 0.35; 'knows': 0.35; 'problem.': 0.35; 'test': 0.35; 'there': 0.35; 'error.': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'subject: ': 0.61; 'telling': 0.64; 'fact,': 0.69; 'text/html;': 0.84
X-Virus-Scanned amavisd-new at torriefamily.org
Date Tue, 28 May 2013 11:17:05 -0600
From Michael Torrie <torriem@gmail.com>
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> <mailman.2251.1369665785.3114.python-list@python.org> <f4c1b04a-7a50-418a-8be9-8a24609e261d@googlegroups.com> <mailman.2299.1369751680.3114.python-list@python.org> <a3405148-c74b-49d9-a37f-5fc19e7434f4@googlegroups.com> <mailman.2305.1369759217.3114.python-list@python.org> <d325d18f-9bb0-4a2e-9eb6-63d56c5aacbf@googlegroups.com>
In-Reply-To <d325d18f-9bb0-4a2e-9eb6-63d56c5aacbf@googlegroups.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2307.1369761431.3114.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369761431 news.xs4all.nl 15978 [2001:888:2000:d::a6]:57052
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46312

Show key headers only | View raw


On 05/28/2013 10:45 AM, Νίκος Γκρ33κ wrote:
> con = pymysql.connect( db = 'pelatologio', host = 'localhost', user = 'blabla', passwd = 'blabla', init_command='SET NAMES UTF8', charset = 'utf-8' )
> 
> produces this "God knows what" error traceback....

Hey at least your database code is now working.

>     /home/nikos/public_html/cgi-bin/metrites.py in ()
>     217                 template = htmldata + counter
>     218         elif page.endswith('.py'):
> =>  219                 htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' + page )
>     220                 template = htmldata.decode('utf-8').replace( 'Content-type: text/html; charset=utf-8', '' ) + counter
>     221                 
> htmldata undefined, subprocess = <module 'subprocess' from '/opt/python3/lib/python3.3/subprocess.py'>, subprocess.check_output = <function check_output>, page = 'pelatologio.py'
>  /opt/python3/lib/python3.3/subprocess.py in check_output(timeout=None, *popenargs=('/home/nikos/public_html/cgi-bin/pelatologio.py',), **kwargs={})
>     584         retcode = process.poll()
>     585         if retcode:
> =>  586             raise CalledProcessError(retcode, process.args, output=output)
>     587     return output
>     588 
> global CalledProcessError = <class 'subprocess.CalledProcessError'>, retcode = 1, process = <subprocess.Popen object>, process.args = '/home/nikos/public_html/cgi-bin/pelatologio.py', output = b'<!--: spam\nContent-Type: text/html\n\n<body b...Type\' object has no attribute \'id\'\n\n-->\n\n'
> CalledProcessError: Command '/home/nikos/public_html/cgi-bin/pelatologio.py' returned non-zero exit status 1 
>       args = (1, '/home/nikos/public_html/cgi-bin/pelatologio.py') 
>       cmd = '/home/nikos/public_html/cgi-bin/pelatologio.py' 
>       output = b'<!--: spam\nContent-Type: text/html\n\n<body b...Type\' object has no attribute \'id\'\n\n-->\n\n' 
>       returncode = 1 
>       with_traceback = <built-in method with_traceback of CalledProcessError object>

Again the traceback is telling you where to look for the problem.  And
the problem is in your own script, pelatologio.py, though the line
number that's causing the problem is obscured.

Basically you want pelatologio.py to run and then you process the output
through a template, correct?

Well the traceback is telling you that pelatologio.py is erroring out.
In fact, subprocess is telling you that this process (your script) quit
with an error.  Though the line number in pelatologio.py is unknown (the
traceback is obscured by your html processing code in your template
processor), the error message itself is not.  Inside pelatologio.py
there is some object that you are trying to reference the "id" attribute
on it does not contain id.

So the problem is in pelatologio.py.  Double check your code there.  Try
to make a standalone test file you can run locally.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 09:36 -0700
  Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 11:20 -0700
  Re: Encodign  issue in Python 3.3.1 (once again) Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-26 16:53 -0400
    Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 14:26 -0700
      Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-27 07:44 +1000
      Re: Encodign  issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:21 +0100
      RE: Encodign  issue in Python 3.3.1 (once again) Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-27 01:31 +0300
      Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-27 08:32 +1000
      Re: Encodign issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:51 +0100
  Re: Encodign  issue in Python 3.3.1 (once again) Tim Roberts <timr@probo.com> - 2013-05-26 19:01 -0700
    Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 22:06 -0700
      Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 07:16 -0700
        Re: Encodign  issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-27 15:45 +0100
          Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 08:37 -0700
            Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-28 01:52 +1000
              Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 09:56 -0700
                Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-28 08:18 +1000
                Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 22:55 -0700
                Re: Encodign issue in Python 3.3.1 (once again) rusi <rustompmody@gmail.com> - 2013-05-28 04:56 -0700
      Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-27 08:42 -0600
        Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 13:17 -0700
          Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 08:34 -0600
            Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-28 09:00 -0700
              Re: Encodign  issue in Python 3.3.1 (once again) MRAB <python@mrabarnett.plus.com> - 2013-05-28 17:26 +0100
              Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 10:40 -0600
                Re: Encodign  issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <support@superhost.gr> - 2013-05-28 09:45 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 11:17 -0600
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 11:08 -0700
                Re: Encodign issue in Python 3.3.1 (once again) Joel Goldstick <joel.goldstick@gmail.com> - 2013-05-28 14:14 -0400
                Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 12:19 -0600
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 12:03 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 12:48 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-29 03:30 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 00:18 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 01:16 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 03:29 -0600
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 03:53 -0700
                Re: Encodign  issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 03:56 -0700
                Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-30 21:33 +1000
                Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <support@superhost.gr> - 2013-05-30 04:47 -0700
                Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 08:35 -0600
                Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-31 00:40 +1000
                Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 11:01 -0600
                Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-31 03:28 +1000
                Re: Encodign issue in Python 3.3.1 (once again) Νικόλαος Κούρας <nikos.gr33k@gmail.com> - 2013-05-31 08:13 -0700

csiph-web