pymacadmin icon indicating copy to clipboard operation
pymacadmin copied to clipboard

non-ASCII characters in notification data crashes crankd

Open GoogleCodeExporter opened this issue 11 years ago • 0 comments

I recently discovered a bug in crankd's handling of characters outside of
standard ASCII when it's parsing the userdata in the notification.

replace the line under:
    for k in [ 'info', 'key' ]:
        if k in kwargs and kwargs[k]:
with:
                child_env['CRANKD_%s' % k.upper()] = str(kwargs[k])
            except Exception:
                child_env['CRANKD_%s' % k.upper()] = kwargs[k].encode('utf-8')

replace the line under:
    if 'user_info' in kwargs:
        for k, v in kwargs['user_info'].items():
with:
            try:
                child_env[create_env_name(k)] = str(v)
            except Exception:
                child_env[create_env_name(k)] = v.encode('utf-8')

This should fix the problem.  I've been running several foreign characters
through crankd to test (such as ë, é) and it hasn't failed.

Original issue reported on code.google.com by [email protected] on 9 Jan 2010 at 7:07

GoogleCodeExporter avatar Mar 13 '15 15:03 GoogleCodeExporter