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


Groups > comp.lang.python > #71657

Re: Psycopg2 : error message.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.036
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'subject:error': 0.03; '16,': 0.03; 'problem:': 0.07; 'cc:addr:python-list': 0.11; '*and': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'url:file': 0.16; 'url:py': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'error': 0.23; 'cc:2**0': 0.24; 'subject: : ': 0.26; 'post': 0.26; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'included': 0.31; 'prints': 0.31; 'url:python': 0.33; 'fri,': 0.33; 'actual': 0.34; 'except': 0.35; 'received:google.com': 0.35; 'useful': 0.36; 'behind': 0.37; 'error.': 0.37; 'generic': 0.38; 'files': 0.38; 'pm,': 0.38; 'bad': 0.39; 'read': 0.60; "you're": 0.61; 'further': 0.61; "you'll": 0.62; 'potentially': 0.81; 'future,': 0.83; 'url:jpg': 0.83; 'bare': 0.84; 'subject:message.': 0.84; 'to:none': 0.92
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:cc :content-type; bh=vuGQB5rG5N5oQOpnCRfRo2n69W9nssenHKNuDW5Rtfs=; b=x4H7HZAsho1Th0qIW1kBqL5hpNbuiyosXkYmxHMC/c9uE4oz+GpWV9yJvdxzrn7us4 WmNI78P6bfVao1O0auFCQcIcjt3LlkaK3DuD4i2/u5+2/ukNXCtgW8GdZeb3QLp+oYVf Rc8D99AbD3atAWHLS+tC7bCs5sg2xXs9lwfgFpzDTqx0Nbn5OUkjGmqI98HZi4k8XE3l CRCqeNF3mTT06iXctiicQlG9N0D2jfStGO1qmyk31AkcQ2idlhbrf8NCrxpfOjuPPYGv DrGLZPkPlCBAbSGFy/JeN14g0WDhvAcwWFRnjJV1bEjAUselImpQeKvxMVOrFUfIbeSU hxwg==
MIME-Version 1.0
X-Received by 10.52.182.227 with SMTP id eh3mr652349vdc.40.1400240368275; Fri, 16 May 2014 04:39:28 -0700 (PDT)
In-Reply-To <1400235507987-5057062.post@n6.nabble.com>
References <1400235507987-5057062.post@n6.nabble.com>
Date Fri, 16 May 2014 21:39:28 +1000
Subject Re: Psycopg2 : error message.
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10067.1400240371.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400240371 news.xs4all.nl 2887 [2001:888:2000:d::a6]:56486
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71657

Show key headers only | View raw


On Fri, May 16, 2014 at 8:18 PM, dandrigo <laurent.celati@gmail.com> wrote:
> Please read the 2 usefull files below :
>
> Dandrigo pg_test.py <http://python.6.x6.nabble.com/file/n5057062/pg_test.py>
>
> SS_dos.JPG <http://python.6.x6.nabble.com/file/n5057062/SS_dos.JPG>

These would be MUCH better included inline. Please, in future, copy
and paste the *text* of the error message - don't post a screenshot.

As to the actual problem: You're masking a potentially useful
exception behind a bare except that just prints a generic message *and
then continues*. This is a very bad idea. Don't do it. Take all that
out and just attempt the connection; then you'll get a useful error.
Same further down. Just don't.

ChrisA

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


Thread

Re: Psycopg2 : error message. Chris Angelico <rosuav@gmail.com> - 2014-05-16 21:39 +1000

csiph-web