Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53074
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ishish@domhain.de> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'subject:: [': 0.04; 'subject:file': 0.07; 'bytes,': 0.09; 'line:': 0.09; 'operand': 0.09; 'valueerror:': 0.09; 'python': 0.11; 'template': 0.14; '4:59': 0.16; 'skip:" 70': 0.16; 'subject:] [': 0.16; 'typeerror:': 0.16; 'types,': 0.16; 'underlying': 0.16; 'exception': 0.16; 'variable': 0.18; '>>>': 0.22; 'aug': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'handling': 0.26; 'query': 0.26; 'skip:" 40': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'occurs': 0.31; 'file': 0.32; 'text': 0.33; 'url:python': 0.33; '(most': 0.33; 'call.': 0.33; 'actual': 0.34; 'convert': 0.35; 'data,': 0.36; 'useful': 0.36; 'so,': 0.37; 'two': 0.37; 'to:addr:python-list': 0.38; 'recent': 0.39; 'legally': 0.39; 'quote': 0.39; 'to:addr:python.org': 0.39; 'conversion': 0.61; 'url:about': 0.61; 'first': 0.61; 'therefore,': 0.64; 'between': 0.67; '8bit%:92': 0.71; 'type(s)': 0.84; 'was:': 0.91 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Date | Tue, 27 Aug 2013 16:22:32 +0100 |
| From | ishish <ishish@domhain.de> |
| To | <python-list@python.org> |
| Subject | Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of |
| In-Reply-To | <kvif5n$drv$2@news.grnet.gr> |
| References | <kvi7ei$2n2$2@news.grnet.gr> <kvi86o$aig$1@news.grnet.gr> <mailman.272.1377613496.19984.python-list@python.org> <kvif5n$drv$2@news.grnet.gr> |
| X-Sender | ishish@domhain.de |
| User-Agent | RoundCube Webmail/0.7.1 |
| 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.275.1377616954.19984.python-list@python.org> (permalink) |
| Lines | 76 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1377616954 news.xs4all.nl 15936 [2001:888:2000:d::a6]:53701 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:53074 |
Show key headers only | View raw
Am 27.08.2013 16:04, schrieb Ferrous Cranus:
> Στις 27/8/2013 4:59 μμ, ο/η ishish έγραψε:
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error
>>> in
>>> sys.excepthook:
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> ValueError: underlying buffer has been detached
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> Original
>>> exception was:
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> Traceback
>>> (most recent call last):
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
>>> "/home/nikos/public_html/cgi-bin/metrites.py", line 169, in
>>> <module>
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
>>>
>>>
>>> "/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
>>> line 108, in execute
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> query
>>> = query % escaped_args
>>> [Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
>>> TypeError: unsupported operand type(s) for %: 'bytes' and 'str'
>>
>> 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:
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