plugin crashes when used on files accessed via gvfs SFTP

Bug #1313112 reported by chenel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gedit-source-code-browser-plugin (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hello,

This plugin seems to continue to work great with local files.

However, I use gedit heavily via the gvfs backend supported by Gnome to edit files over an SFTP connection. I've found that the version of the source code browser included with Trusty crashes when I try to edit one of those files with the following exception:

Gtk-Message: Failed to load module "overlay-scrollbar"
Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/sourcecodebrowser/plugin.py", line 460, in on_tab_state_changed
    self._load_active_document_symbols()
  File "/usr/lib/gedit/plugins/sourcecodebrowser/plugin.py", line 416, in _load_active_document_symbols
    os.write(fd, contents)
TypeError: 'str' does not support the buffer interface

I am not sure if this is the 'correct' solution, but after googling I was able to make the plugin work by editing line 416 of /usr/lib/gedit/plugins/sourcecodebrowser/plugin.py to read

os.write(fd, bytes(contents, 'UTF-8'))

instead of

os.write(fd, contents, 'UTF-8')

Let me know if you need further information. Thanks.

Revision history for this message
chenel (jeremy-wolcott) wrote :

Whoops. Line 416 used to read

os.write(fd, contents)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gedit-source-code-browser-plugin - 3.0.3-5

---------------
gedit-source-code-browser-plugin (3.0.3-5) unstable; urgency=medium

  * Patch: fix opening of remote files (LP: #1313112)
  * Refer to packaging branch in "Vcs-Git" field

 -- Pietro Battiston <email address hidden> Fri, 4 Jul 2014 16:12:01 +0200

Changed in gedit-source-code-browser-plugin (Ubuntu):
status: New → Fix Released
Revision history for this message
Alexandre (alexandre67fr) wrote :

On latest Ubuntu 15.10, a quick solution can be to open /usr/lib/gedit/plugins/sourcecodebrowser/plugin.py, , find line 416 and replace

os.write(fd, contents)

with

os.write(fd, bytes(contents, 'UTF-8'))

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.