An error when i switched from python v2.6.6 => v3.2.3

Chris Angelico rosuav at gmail.com
Thu Mar 7 15:48:31 CET 2013


On Fri, Mar 8, 2013 at 1:44 AM, Νίκος Γκρ33κ <nikos.gr33k at gmail.com> wrote:
>  /home/nikos/public_html/cgi-bin/metrites.py in ()
>   220                 htmldata = f.read()
>   221         elif htmlpage.endswith('.py'):
>   222                 os.system( 'python metrites.py > %s' ) % htmltemp
>   223                 f = open( htmltemp )
>   224                 htmldata = f.read()
> os = <module 'os' from '/usr/lib64/python2.6/os.pyc'>, os.system = <built-in function system>, htmltemp = '/home/nikos/www/data/private/htmltemp'
> <type 'exceptions.TypeError'>: unsupported operand type(s) for %: 'int' and 'str'
>       args = ("unsupported operand type(s) for %: 'int' and 'str'",)
>       message = "unsupported operand type(s) for %: 'int' and 'str'"
>
> Τhis is the complete traceback iam reading it and reading it all over but i just dont *see* what it tries to tell me.

Try to get the default output from an exception, it's a lot more
useful. In any case, line 222 is the one being highlighted; you get a
couple of lines of context, but the middle one is where the error is.

ChrisA



More information about the Python-list mailing list