wadetb / Sublime-Text-Advanced-CSV

Efficiently format, edit, arrange, and evaluate cells in CSV files
169 stars 14 forks source link

Update csvplugin.py #14

Closed fr4nk closed 9 years ago

fr4nk commented 9 years ago

Hi guys,

in the line i changed the following code

 sublime.settings.get('delimiter')

delivers a unicode, not a str. The check with instanceof fails therefor.

You can see a message like

',' is not a valid delimiter, reverting to ','."

in commandline.

Please check if i'm right. Maybe it is caused somewhere else. In my Installation i tried it and it worked. I initialy found it while changing the delimiter from comma to a semicolon.

wadetb commented 9 years ago

Hi @fr4nk, this looks like a Python 2 vs Python 3 issue, as the unicode type is gone in the latter. (Sublime Text 2 uses Python 2, Sublime Text 3 uses Python 3)

I think the most portable solution would be to call str() on the delimiter and catch any exception.

fr4nk commented 9 years ago

Hi Wade, thanks for your quick reply. So - it's not that easy ... ;-) Right, i use the package in sublime_text 2 I already wondered and suspected it was some more about it. I'll try to find a solution that is vaild for Python2 and 3. And maybe upgrade to ST3

wadetb commented 9 years ago

Hey, I finally got around to resolving this in a way that should work for ST2 and ST3.