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

Notification data passing error #126

Closed
rejsmont opened this issue Nov 29, 2019 · 2 comments · Fixed by #131
Closed

Notification data passing error #126

rejsmont opened this issue Nov 29, 2019 · 2 comments · Fixed by #131

Comments

@rejsmont
Copy link

rejsmont commented Nov 29, 2019

Hi,

passing data to the notification center does not work. The sample app:

import rumps

@rumps.notifications
def notification_center(info):
    print(info)

class TestApp(rumps.App):
    @rumps.clicked('Test Notification')
    def testing(self, sender):
        test = 'test string'
        rumps.notification("Foo", "Bar", "Baz", data={'foo': 'bar'}, action_button='Action', other_button='Dismiss')

if __name__ == "__main__":
    app = TestApp('Test')
    app.run()

throws the following exception:

2019-11-29 18:03:11.936 Python[74881:1454881] -[OC_BuiltinPythonData fastestEncoding]: unrecognized selector sent to instance 0x7fa05ed3e910
/Users/rejsmont/src/rumps_test/venv/lib/python3.7/site-packages/rumps/rumps.py:185: UninitializedDeallocWarning: leaking an uninitialized object of type NSPlaceholderString
  ns_string = NSString.alloc().initWithString_(dumped)

Python version:

# python -V
Python 3.7.5

PIP packages installed:

Package                Version
---------------------- -------
Cython                 0.29.14
pathtools              0.1.2
pip                    19.3.1
pyobjc-core            6.1
pyobjc-framework-Cocoa 6.1
PyYAML                 5.1.2
rumps                  0.3.0
setuptools             42.0.0
@jaredks
Copy link
Owner

jaredks commented Mar 17, 2020

Thanks for this! Very clear minimal reproducible sample 👍 I believe it should be corrected in #131. Has to do with bytes being returned from pickle (default serializer) in Python 3.

A workaround I suppose is to use another serializer that doesn't fail for Python 3 but it should obviously work out of the box.

@jaredks
Copy link
Owner

jaredks commented May 9, 2020

Did anyone test that PR regarding this issue?

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

Successfully merging a pull request may close this issue.

2 participants