encoding - Lighttpd and Python web page: Cannot not convert data into an integer -


please, making easy python web page without framework. have problem if tried value tuple

#!/usr/bin/env python3 # -*- encoding: utf-8 -*- import cgitb cgitb.enable() # code here  # .... # months in slovak language months = ('január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december') month = int(last_day_of_month(today).strftime("%m")) # code here # ... # print ("\t" + '<title>{0} {1}' + str(months[month-1]) + ' ' + str(year) + '</title>') 

here got error:

cannot not convert data integer

it works if months defined in ascii, like:

months = ('janury', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december') 

this works right. of course, file in utf-8 encoding , in python console works fine (print whole page without problem)

maybe not problem of python maybe it's problem of lighttpd local server. be?

i tried tricks in python forced convert int int() function or printing month format:

print ("\t" + '<title>{0} {1}</title>'.format(months[1], year)) 

any ideas problem?

thanks ideas

edit: whole code function defitions here:

https://pastebin.com/b9hknfyc


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -