SublimeGtags icon indicating copy to clipboard operation
SublimeGtags copied to clipboard

For Sublime Text Build 3114 x64, it cannot works!!!!

Open tianakack opened this issue 8 years ago • 1 comments

The ERROR information is:

TypeError: environment can only contain strings

I have found that path.encode('utf-8') causes this problem in the file D:...\Sublime Text\Data\Packages\SublimeGtags\gtags.py, it will convert the "F:/project" to b"F:/project":

class TagFile(object):
    def _expand_path(self, path):
        path = os.path.expandvars(os.path.expanduser(path))
        if IS_WINDOWS:
            path = path.encode('utf-8')
        return path

So, I added this If statement if int(sublime.version()) < 3000::

class TagFile(object):
    def _expand_path(self, path):
        path = os.path.expandvars(os.path.expanduser(path))
        if IS_WINDOWS:
            if int(sublime.version()) < 3000:
                path = path.encode('utf-8')
        return path

NOW, it works fine~!

tianakack avatar Jun 04 '16 08:06 tianakack

Great work! Thanks tianjun9 to fix this bug.

kpld avatar Aug 03 '17 10:08 kpld