GNOME Bugzilla – Bug 707026
Shell commands in snippets trigger error message
Last modified: 2014-01-18 22:29:21 UTC
Created attachment 253471 [details] [review] Rough attempt at a fix Hi, When trying to use a shell command in the snippets, as described in the documentation [1], an error message always appear and the shell command's output is never inserted. Steps to reproduce ------------------ 1) Create a new snippet: Content of the snippet: $(date) Tab trigger: foobar 2) In editor window, type "foobar" (without quotes) then press <TAB> Expected result: ---------------- "foobar" is replaced by the current date and time Actual result: -------------- An error message pops out after ~1sec saying: > Execution of the shell command (date) exceeded the maximum time; execution aborted. Additional information: ----------------------- When opened from a terminal, a python traceback is displayed when the error happens: Traceback (most recent call last):
+ Trace 232432
func_fdtransform = lambda _, cond, data: func(channel, cond, data)
return (lambda a1, a2, data: callback(a1, a2, *data), user_data)
self.shell_output += line TypeError: Can't convert 'bytes' object to str implicitly
From a quick look, this breakage seems to have been introduced in commit ebbb4e5ae48269dbfcf758b7865351d010937320. The attached patch fixes the issue on my machine. Let me know if I can help any further, Thanks. [1] https://wiki.gnome.org/Apps/Gedit/Plugins/Snippets
Thanks! the patch makes sense to me, this is probably a fallout of the python3 conversion. Could you attach the patch as a "git format-patch" so that we can commit it giving you the proper credit? See https://wiki.gnome.org/GnomeLove/SubmittingPatches for more details
Created attachment 253477 [details] [review] Proper format-patch as requested
Review of attachment 253477 [details] [review]: pushed, thank you!
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Thanks for the quick and friendly response. Have a nice day!
Can this fix please be backported to the 3.8 branch? Just ran into this bug on Fedora 19, which is still supported for another 6 months. I'll backport the fix downstream, but seems like something that should be done upstream too. Thanks!
Adam go ahead and push it upstream, as far as they don't add new strings I am fine with it.
I don't have any gnome.org commit privs, I'm not a GNOME dev.
Backported to gnome-3-8.