You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oct 2 04:29:02 pluto org.crankd.plist[58620]: INFO: NSWorkspace Notification
NSWorkspaceDidWakeNotification: executing /bin/echo "The system woke from
sleep!"
Oct 2 04:29:02 pluto org.crankd.plist[58620]: Traceback (most recent call
last):
Oct 2 04:29:02 pluto org.crankd.plist[58620]: File
"/usr/local/sbin/crankd.py", line 597, in <module>
Oct 2 04:29:02 pluto org.crankd.plist[58620]: main()
Oct 2 04:29:02 pluto org.crankd.plist[58620]: File
"/usr/local/sbin/crankd.py", line 523, in main
Oct 2 04:29:02 pluto org.crankd.plist[58620]:
AppHelper.runConsoleEventLoop(installInterrupt=True)
Oct 2 04:29:02 pluto org.crankd.plist[58620]: File
"/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyOb
jC/PyObjCTools/AppHelper.py", line 178, in runConsoleEventLoop
Oct 2 04:29:02 pluto org.crankd.plist[58620]: if not
runLoop.runMode_beforeDate_(mode, nextfire):
Oct 2 04:29:02 pluto org.crankd.plist[58620]: File
"/usr/local/sbin/crankd.py", line 110, in onNotification_
Oct 2 04:29:02 pluto org.crankd.plist[58620]:
self.callable(user_info=user_info) # pylint: disable-msg=E1101
Oct 2 04:29:02 pluto org.crankd.plist[58620]: File
"/usr/local/sbin/crankd.py", line 558, in do_shell
Oct 2 04:29:02 pluto org.crankd.plist[58620]: for k, v in
kwargs['user_info'].items():
Oct 2 04:29:02 pluto org.crankd.plist[58620]: AttributeError: 'NoneType'
object has no attribute 'items'
Original issue reported on code.google.com by [email protected] on 2 Oct 2011 at 8:36
I'm no python expert, but I inserted a line as follows and it works.
$ diff -Naur crankd.py.orig crankd.py
--- crankd.py.orig 2012-01-11 21:01:38.000000000 +0800
+++ crankd.py 2012-01-11 20:30:16.000000000 +0800
@@ -557,8 +557,9 @@
child_env['CRANKD_%s' % k.upper()] = str(kwargs[k])
if 'user_info' in kwargs:
- for k, v in kwargs['user_info'].items():
- child_env[create_env_name(k)] = str(v)
+ if kwargs['user_info'] is not None:
+ for k, v in kwargs['user_info'].items():
+ child_env[create_env_name(k)] = str(v)
try:
rc = call(command, shell=True, env=child_env)
I went with something similar to handle the case where user_info is present but
None:
https://github.com/acdha/pymacadmin/commit/533b6c4c4379f0632e2fdebfbe115f9880cb4
cab
From @GoogleCodeExporter on May 20, 2015 16:39
Original issue reported on code.google.com by
[email protected]
on 2 Oct 2011 at 8:36Copied from original issue: #7
The text was updated successfully, but these errors were encountered: