Sublime Forum

Python version problem Mac Os X

#1

Hi folks,

Iā€™ve just installed CTags plugin. And It dont want to work. If I select ā€œCTags: Rebuild Tagsā€ plugin exit with strange error message:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./ctagsplugin.py", line 597, in run
  File "./ctagsplugin.py", line 196, in find_top_folder
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 119, in dirname
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

I think it is common Python problem. I have other version of Python over macports installed. And use from Teminal a macports version of Python from /opt/local/bin. But Sublime seems to run buildin Python version. Can be that a problem?

0 Likes

#2

Do you have any unsaved files by any chance? Line 597 calls self.view.file_name() which will be None for unsaved files and hence you end up getting what you are seeing.

0 Likes

#3

Dear quanster,

thank you for your reply. I checked that line already and all project files was successfully saved. In addition I ran ā€œRebuildā€¦ā€ on whole project with all files closed. Tried another project ā€” no chance.

0 Likes

#4

This has nothing to do with python versions. The plugin is calling os.path.dirname(None), which leads to the stack trace youā€™re seeing.

0 Likes

#5

Hrmm, looks like someone handily refactored the tag finding code :confused:

Open an issue:
github.com/SublimeText/CTags/issues

Hopefully someone will sort it out

0 Likes