Python Forum
is this a good way to catch exceptions?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is this a good way to catch exceptions?
#10
You really shouldn't be concatenating strings to put data in SQL statements (line 23) - SQL injection is the problem with that. Whichever database you're using will have placeholder characters that you put in the string and execute takes an additional argument that lets you pass the values you want. See the docs for the library for details on how to do this correctly.
buran likes this post
Reply


Messages In This Thread
RE: is this a good way to catch exceptions? - by ndc85430 - Jul-02-2021, 05:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  try catch not working? korenron 2 918 Jan-15-2023, 01:54 PM
Last Post: korenron
  PiCamera - print exceptions? korenron 2 894 Dec-15-2022, 10:48 PM
Last Post: Larz60+
  Multiprocessing queue catch get timeout Pythocodras 1 2,452 Apr-22-2022, 06:01 PM
Last Post: Pythocodras
  Class exceptions DPaul 1 1,351 Mar-11-2022, 09:01 AM
Last Post: Gribouillis
  twisted: catch return from sql wardancer84 0 1,568 Sep-08-2021, 12:38 PM
Last Post: wardancer84
  how to catch schema error? maiya 0 1,913 Jul-16-2021, 08:37 AM
Last Post: maiya
  pool mysql error - not catch by try\except? korenron 1 2,203 Jul-05-2021, 11:26 AM
Last Post: ibreeden
  Python, exceptions KingKhan248 6 3,136 Nov-15-2020, 06:54 AM
Last Post: buran
  try catch question ,get data from main code korenron 7 3,272 Nov-03-2020, 09:28 AM
Last Post: korenron
  Split string between two different delimiters, with exceptions DreamingInsanity 2 2,106 Aug-24-2020, 08:23 AM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020