Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53121
| Date | 2013-08-28 11:11 +0100 |
|---|---|
| From | ishish <ishish@domhain.de> |
| Subject | Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of |
| References | (1 earlier) <kvi86o$aig$1@news.grnet.gr> <mailman.272.1377613496.19984.python-list@python.org> <kvif5n$drv$2@news.grnet.gr> <mailman.275.1377616954.19984.python-list@python.org> <39be9227-c800-49a5-850d-f387c30d1e9d@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.297.1377684668.19984.python-list@python.org> (permalink) |
Am 28.08.2013 10:48, schrieb Ferrous Cranus:
>> >> I quote from a Python 3 Guide
>>
>> >> [http://python.about.com/od/python30/ss/30_strings_3.htm]:
>>
>> >>
>>
>> >> The two data types, str and bytes, are mutually exclusive. One
>>
>> >> cannot
>>
>> >> legally combine them into one call. With the distinction between
>>
>> >> text
>>
>> >> and data, therefore, comes the need to convert between them.
>>
>> >>
>>
>> >>
>>
>> >
>>
>> > So, in this line:
>>
>> >
>>
>> > cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
>>
>> >
>>
>> > the variable 'page' needs conversion to what?
>>
>> >
>>
>> > all that is stores is the location of a file
>>
>> >
>>
>> > path = '/home/nikos/public_html/'
>>
>> >
>>
>> > page = form.getvalue('page')
>>
>> >
>>
>> > if not page and os.path.exists( file ):
>>
>> > # it is an html template
>>
>> > page = file.replace( path, '' )
>>
>> >
>>
>> > So chnage it to what?
>>
>> > --
>>
>> > What is now proved was at first only imagined!
>>
>>
>>
>>
>>
>> The error occurs in file
>>
>>
>> "/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
>>
>> line 108, in execute
>>
>> query = query % escaped_args
>>
>>
>>
>> You can check the actual values and data types using:
>>
>>
>>
>> print repr(query)
>>
>> print type(query)
>>
>>
>>
>> print repr(escaped_args)
>>
>> print type(escaped_args)
>>
>>
>>
>> Always useful is a proper exception handling using try:/except:
>
>
> hOW YOU MEAN PLEASE I TRY TO IMPLMENT WHAT YOU PROPOSE BUT I CANT.
>
> try:
> #find the needed counter for the page URL
> if os.path.exists( path + page ) or os.path.exists( cgi_path + page
> ):
> cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
> data = cur.fetchone() #URL is unique, so should only be one
>
>
> print repr('''SELECT ID FROM counters WHERE url = %s''')
> print type('''SELECT ID FROM counters WHERE url = %s''')
>
> print repr(escaped_args)
> print type(escaped_args)
>
> I MEAN IF FAILS BEFORE IT TRIES TO GO INTO MY PRINT STAEMNT.
> HOW AM I GONNA CPATURE THE QUERY?
http://i.stack.imgur.com/jiFfM.jpg
http://wiki.python.org/moin/HandlingExceptions
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos@superhost.gr> - 2013-08-27 15:52 +0300
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos@superhost.gr> - 2013-08-27 16:05 +0300
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos@superhost.gr> - 2013-08-27 16:35 +0300
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-08-27 19:20 -0400
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of ishish <ishish@domhain.de> - 2013-08-27 14:59 +0100
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos@superhost.gr> - 2013-08-27 18:04 +0300
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of ishish <ishish@domhain.de> - 2013-08-27 16:22 +0100
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 02:48 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of ishish <ishish@domhain.de> - 2013-08-28 11:11 +0100
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 03:43 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 03:46 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 04:14 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Dave Angel <davea@davea.name> - 2013-08-28 11:32 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 04:35 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 04:38 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Dave Angel <davea@davea.name> - 2013-08-28 18:40 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 04:55 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-08-28 15:38 +0200
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 07:58 -0700
RE: [error] [client 178.59.111.223] (2)No such file or directory: exec of "Prasad, Ramit" <ramit.prasad@jpmorgan.com.dmarc.invalid> - 2013-08-28 18:44 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 22:49 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-28 18:56 -0400
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 23:36 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Chris Angelico <rosuav@gmail.com> - 2013-08-29 08:55 +1000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of ishish <ishish@domhain.de> - 2013-08-28 12:51 +0100
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 05:03 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of ishish <ishish@domhain.de> - 2013-08-28 13:16 +0100
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 12:21 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 05:36 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-27 17:07 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 01:46 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 02:24 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 12:11 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 05:17 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 12:38 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 05:48 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 06:11 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 22:56 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-08-28 21:20 -0700
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Steven D'Aprano <steve@pearwood.info> - 2013-08-29 06:30 +0000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Cameron Simpson <cs@zip.com.au> - 2013-08-29 11:01 +1000
Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of Cameron Simpson <cs@zip.com.au> - 2013-08-29 11:04 +1000
csiph-web