| Summary: | mailchecker fails with add_action() number of arguments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Barry Fishman <barry> | ||||
| Component: | mailnag | Assignee: | Thorsten Leemhuis <fedora> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 20 | CC: | fedora | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | mailnag-0.5.2-4.fc20 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-11-12 00:38:40 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
The problem is related to the python import from gi.repository import Notify and the add_action() interface code in the Notify object. So might be better assigned to a pygobject or even the gobject-introspection package. (In reply to Barry Fishman from comment #1) > So might be better assigned to a pygobject or even the gobject-introspection > package. Downgrading to libnotify 0.7.5 solves the problem for me; there are only small changes between 0.7.5 and 0.7.6 (one of them touching add_action), so I'd say that is the root of the problem (see Bug report in Gnomes bugzilla for details). Or am I missing something? As a work around I changed: /usr/lib/python2.7/site-packages/Mailnag/daemon/mailchecker.py removing the last "None" argument in the two calls to add_notify(). Things now seems to work fine. I have not been able to get my head around the pygobject code, I don't know where in the object tree the add_action() method exists. The file: /usr/share/gir-1.0/Notify-0.7.gir gives add_notify 7 arguments (including the object), the last one being a function to free the callbacks data argument. There is some old discussion in the pygobject git log that the free function did not seem to be needed, but nowhere did I see an API change explicitly done (nor can I any code that would do it), and nobody in the gnome bugzilla seem to want to confirm a change. However, if it is an API change, it means that all python applications using gi.repository.Notify will need to be updated. In my previous message I overstated "seems to work".
Another error now causes the program to crash. A test for the settings:
org.gnome.shell saved-session-presence.
The code:
# play sound if it is enabled in mailnags settings and
# gnome-shell notifications aren't disabled
if (self._cfg.get('general', 'playsound') == '1') and \
(self._gsettings.get_int('saved-session-presence') != 2):
gstplay(get_data_file(self._cfg.get('general', 'soundfile')))
Causes an abort
I patched this to test for the existance of the key first.
# play sound if it is enabled in mailnags settings and
# gnome-shell notifications aren't disabled
if (self._cfg.get('general', 'playsound') == '1') and \
('saved-sesion-presence' in self._gsettings) and \
(self._gsettings.get_int('saved-session-presence') != 2):
gstplay(get_data_file(self._cfg.get('general', 'soundfile')))
avoiding the crash but also the sound.
Someone who knows what they are doing should really look at this. :-(
I reported the bug upstream. I have a patch, but neither bug tracking
system seems to be able to be able to deal with attachments.
My current code uses:
if (self._cfg.get('general', 'playsound') == '1') and \
(('saved-sesion-presence' not in self._gsettings) or \
(self._gsettings.get_int('saved-session-presence') != 2)):
gstplay(get_data_file(self._cfg.get('general', 'soundfile')))
Created attachment 816224 [details]
Fix for libnotify interface and GNOME 3.10 protocol changes.
The bug has been fixed in mailnag-next branch of the upstream repository git://github.com/pulb/mailnag.git.
That branch is a major code reorganization, and is under current development. It might be better to fix the problem with something like my attached patch until a new upstream version is released.
mailnag-0.5.2-3.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mailnag-0.5.2-3.fc20 Package mailnag-0.5.2-3.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mailnag-0.5.2-3.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-20571/mailnag-0.5.2-3.fc20 then log in and leave karma (feedback). Two updates to Mailnag came through, and its is broken again. Why didn't you use my damn patch! See comment #4. Gnome 3.14 no longer uses saved-session-presence. Either use my patch or remove the gsetting.get_int('save-session-presence') call. (In reply to Barry Fishman from comment #9) > Why didn't you use my damn patch! There were basically two reasons I didn't take it * I forgot about that problem (I'm human); that's why it's better to have one bug per problem * it's unwise to mix fixes for different problems in one patch; it iirc is indirectly discouraged by the packaging guidelines Whatever, doesn't matter. Is the sound part of you patch upstream committed somewhere or does the issue not exists in the master branch? And your patch afaics contains a typo: + (('saved-sesion-presence' not in self._gsettings) or \ ^^ Shouldn't that be "session"? If yes: Does the patch really work as indented? Sorry for the tetchiness.
Yes, the patch worked as is, although the code has the mistake you noted. But, neither saved-sesion-presence or saved-session-presence should be defined in self._gsettings. A better change might be to remove the whole test, and use:
if (self._cfg.get('general', 'playsound') == '1'):
gstplay(get_data_file(self._cfg.get('general', 'soundfile')))
When I diff-ed the new installed 'mailchecker.py' with my own file, the only other change I found was that installed file had extra trailing tabs in line 150.
The file has a lot of trailing space.
The fixes really should be applied upstream, but the author has moved on to developing the next version of the code.
I do respect your effort to keep the Fedora package working.
mailnag-0.5.2-4.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mailnag-0.5.2-4.fc20 mailnag-0.5.2-4.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. |
Description of problem: No new mail is seen when some exists. The ~/.config/mailnag/mailnag.log file show a python level error. Version-Release number of selected component (if applicable): mailnag.noarch 0.5.2-2.fc20 How reproducible: always Steps to Reproduce: 1. run mailnag 2. no new mail when some exists 3. look in ~/.config/mailnag/mailnag.log Actual results: Checking 4 email account(s) at: Sun Oct 6 11:35:00 2013 KeyError exception for key 'Subject' in message. Could not get subject from POP message. Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/Mailnag/mailnag.py", line 150, in poll_func mailchecker.check(non_idle_accounts) File "/usr/lib/python2.7/site-packages/Mailnag/daemon/mailchecker.py", line 99, in check self._notify_single(new_mails) File "/usr/lib/python2.7/site-packages/Mailnag/daemon/mailchecker.py", line 148, in _notify_single n = self._get_notification(mail.sender, mail.subject, "mail-unread") File "/usr/lib/python2.7/site-packages/Mailnag/daemon/mailchecker.py", line 158, in _get_notification n.add_action("default", "default", self._notification_action_handler, None, None) TypeError: add_action() takes exactly 5 arguments (6 given) Expected results: Just the first line shown. Additional info: Seems to be similar to bug 1010509 in where python fails