thank you for the log.
I'm trying to reproduce, wrapping my head around this.
you say x.companyname is an utf8 value. Then the problem "goes away" if you 
do x.companyname.encode('utf8') ..... so basically the point is that if you 
print unicode data, the error shows up, while printing strings it's safe 
(because u'something'.encode('utf8') is a 'str' vs 'unicode').

Let's try that out 

Fresh app (my is named "un", pick your poison ^_^). In models/scheduler.py, 
add

from gluon.scheduler import Scheduler

def test():
   print u'something'

def test2():
    print u'something'.encode('utf8')

mysched = Scheduler(db)



go to appadmin, add to the scheduler_task table the two functions, and run 
the scheduler. I had to kill it after the execution of the tasks, so mine 
is behaving correctly in this small test-app

my output is
niphlod@li-mostro7:~/Scrivania/web2py_source$ web2py/web2py.py -K un -D 0
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.1.0 (2012-10-10 15:15:45) dev
Database drivers available: SQLite(sqlite2), SQLite(sqlite3), MySQL(pymysql
), PostgreSQL(psycopg2), PostgreSQL(pg8000), CouchDB(couchdb), IMAP(imaplib)
starting single-scheduler for "un"...
DEBUG:root:defining tables (migrate=True)
DEBUG:root:thread building own DAL object
DEBUG:root:looping...
DEBUG:root:defining tables (migrate=False)
DEBUG:root:nothing to do
DEBUG:root:sleeping...
DEBUG:root:    freeing workers that have not sent heartbeat
INFO:root:TICKER: I'm a ticker (li-mostro7#3905)
DEBUG:root:looping...
INFO:root:TICKER: workers are 1
INFO:root:TICKER: tasks are 2
DEBUG:root:sleeping...
DEBUG:root:........recording heartbeat
DEBUG:root:looping...
DEBUG:root:........recording heartbeat
DEBUG:root:   work to do 1
DEBUG:root:    new scheduler_run record
INFO:root:new task 1 "test" un/appadmin.test
DEBUG:root: new task allocated: un/appadmin.test
DEBUG:root:   task starting
DEBUG:root:    task started
DEBUG:root:    new task report: COMPLETED
DEBUG:root:   result: 1
DEBUG:root: partial output: "hi
"
DEBUG:root:  task completed or failed
DEBUG:root: recording task report in db (COMPLETED)
INFO:root:task completed (COMPLETED)
DEBUG:root:looping...
DEBUG:root:   work to do 2
DEBUG:root:    new scheduler_run record
INFO:root:new task 2 "test1" un/appadmin.test1
DEBUG:root: new task allocated: un/appadmin.test1
DEBUG:root:   task starting
DEBUG:root:    task started
DEBUG:root:    new task report: COMPLETED
DEBUG:root:   result: 1
DEBUG:root: partial output: "hi
"
DEBUG:root:  task completed or failed
DEBUG:root: recording task report in db (COMPLETED)
INFO:root:task completed (COMPLETED)
DEBUG:root:looping...
DEBUG:root:nothing to do
DEBUG:root:sleeping...
DEBUG:root:........recording heartbeat
DEBUG:root:looping...
DEBUG:root:nothing to do
DEBUG:root:sleeping...
DEBUG:root:........recording heartbeat
DEBUG:root:looping...
DEBUG:root:nothing to do
DEBUG:root:sleeping...
^CINFO:root:catched
INFO:root:die!

Try it on your platform: if this fails, we can nail down better the issue 
you're having

-- 



Reply via email to