Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-ASCII characters in notification data crashes crankd #4

Open
acdha opened this issue May 20, 2015 · 0 comments
Open

non-ASCII characters in notification data crashes crankd #4

acdha opened this issue May 20, 2015 · 0 comments

Comments

@acdha
Copy link
Member

acdha commented May 20, 2015

From @GoogleCodeExporter on May 20, 2015 16:39

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

Copied from original issue: #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant