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


Groups > comp.lang.python > #73614 > unrolled thread

Re: protect psycopg script from sql injection?

Started byPeter Otten <__peter__@web.de>
First post2014-06-26 11:49 +0200
Last post2014-06-26 11:49 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: protect psycopg script from sql injection? Peter Otten <__peter__@web.de> - 2014-06-26 11:49 +0200

#73614 — Re: protect psycopg script from sql injection?

FromPeter Otten <__peter__@web.de>
Date2014-06-26 11:49 +0200
SubjectRe: protect psycopg script from sql injection?
Message-ID<mailman.11255.1403776190.18130.python-list@python.org>
celati Laurent wrote:

> I coded this following python script via psycopg;
> 
> web_service_test.py
> <http://python.6.x6.nabble.com/file/n5062113/web_service_test.py>
> 
> 1/ When i execute it, the result is 'bad resquest'. Could you tell me why?

No, but you might find out yourself. When you remove the overly broad

try:
    ... # code that may fail
except:
    print "Bad request"

and just keep the code in the try suite


... # code that may fail

Python will produce an informative traceback. In the (unlikely) case that 
with that extra information you still cannot find the problem in your code 
come back here and post the complete traceback.


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web