facelessuser/SubNotify

[Bug] TypeError: __str__ returned non-string (type bytes)

Kristinita opened this issue · 7 comments

1. Summary

I get stack trace in console if I run Sublime Text.

2. Expected behavior

No stack trace in console.

3. Actual behavior

See full console output on Gist — https://gist.github.com/Kristinita/febc52b90ef3e29b4cdfc428e00a4e6c.

4. Settings

My User/sub_notify.sublime-settings file

{
    "debug": true,
    "enable_growl": true
}

I install Growl for Windows via Chocolatey. I make a patch, Growl worked normally for me.

5. Steps to reproduce

The problem is reproduced for me in a version of Sublime Text without plugins and user settings. Also I use Logging Control package for more debugging details.

I install Growl and SubNotify → I set SubNotify → I restart Sublime Text → I get stack trace in console.

5. Environment

Operating system and version:
Windows 32-bit 10.0.14393
Sublime Text:
Build 3126
Growl for Windows:
2.0.9.20130406

Thanks.

This is what I get when I run the test command. I installed the Logging Control plugin and have it set to default settings:

>>> sublime.run_command('sub_notify_test')
08:53:06 INFO         gntp.notifier:120               notify() Sending notification [Info] to localhost:23053
08:53:06 INFO         gntp.notifier:71            _checkIcon() Checking icon

So it is working for me.


Did you restart after installing SubNotify?

Are you on Windows 10? I haven't verified Windows 10 yet, but I can later on my Windows 10 machine.

I don't know if there is something weird about the Chocolatey install. Can you try and install via the official installer? http://www.growlforwindows.com/gfw/

I installed growl via the official installer (not Chocolatey) on Windows 10. And installed Subnotify. Installed Logging Control. Restarted Sublime to ensure all new packages loaded proper. Subnotify with growl seemed to work fine.

>>> sublime.run_command('sub_notify_test')
17:19:41 INFO         gntp.notifier:120               notify() Sending notification [Info] to localhost:23053
17:19:41 INFO         gntp.notifier:71            _checkIcon() Checking icon

I would try to re-install growl with the official installer. Make sure growl is running. I would uninstall and reinstall SubNotify. I would restart Sublime after re-installing SubNotify. And then run the command sublime.run_command('sub_notify_test') from sublime's console.

@facelessuser, I remove Chocolatey version Growl → I install Growl from official site → I restart Windows → I remove SubNotify → I install SubNotify via Package Control → I restart Sublime Text → I get same stack trace in console.

The problem is reproduced for me in a version of Sublime Text without plugins and user settings.

My User/logging_control.sublime-settings file:

{
    "logging_file_enabled": true,
    "logging_root_level": "DEBUG"
}

Thanks.

Okay, the gntp module, which this package uses, has a new version (version 1.0.3) that address some issues with python 3 not returning data in unicode as expected. They mention that the logging module could get confused which sounds like what you are seeing. This is not a bug directly with SubNotify, but with the gntp module it is using.

With that said, I have not been able to reproduce your issue, so I am only guessing this will fix it. I will upgrade the gntp module to 1.0.3 and hope it fixes things. I will probably move gntp to an external PackageControl dependency as well.

Hopefully sometime this weekend I will get the fix in, but I will have to wait for PackageControl maintainers to merge this change in.

For tracking, I can't make a release until this merges: wbond/package_control_channel#5984. So if you need a status, you can keep an eye on that Package Control issue. When that is merged, I will make a release.

Resolution is taking a bit too long, I may release a version with gntp bundled with it as I have no idea when Package Control will ever get to my merge.

Package Control finally merged gntp dependency. Finally got a release out. Hopefully when this updates the described problem will be fixed.