Exception running CabalInspector #35

Closed
libscott opened this Issue Mar 17, 2013 · 6 comments

Comments

Projects
None yet
3 participants

Log shows an exception:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "./autocomplete.py", line 902, in run
  File "./autocomplete.py", line 944, in _refresh_all_module_info
  File "./autocomplete.py", line 995, in _refresh_module_info
  File "./sublime_haskell_common.py", line 336, in get_source_dir
  File "./sublime_haskell_common.py", line 94, in call_and_wait
  File "./sublime_haskell_common.py", line 137, in call_and_wait_with_input
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, tuple found

The locals() in call_with_wait_and_input before the call to subprocess:

{'PATH': u'/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/scott/bin',
 'command': [u'/Users/ssadler/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/CabalInspector',
             (u'eq', u'/Users/scott/Code/eq/eq.cabal')],
 'extended_env': {...},
 'input_string': None,
 'popen_kwargs': {}}

Looks like the offending tuple is: (u'eq', u'/Users/scott/Code/eq/eq.cabal')

Not sure how to fix this, it does run several times successfully before failing.

A couple of other exceptions in the log below, you can see the commands being run prefixed with >>>:

startup, version: 2217 osx x64 channel: stable
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
working dir: /
packages path: /Users/scott/Library/Application Support/Sublime Text 2/Packages
settings path: /Users/scott/Library/Application Support/Sublime Text 2/Settings
PackageSetup not required
catalogue loaded
found 8 files for base name Default.sublime-keymap
found 2 files for base name Default.sublime-mousemap
found 5 files for base name Main.sublime-menu
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/ColorPicker/sublimecp.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/copy_path.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/delete_word.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/detect_indentation.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/duplicate_line.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/echo.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/exec.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/fold.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/font.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/goto_line.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/indentation.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/kill_ring.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/mark.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/new_templates.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/open_file_settings.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/open_in_browser.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/paragraph.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/save_on_focus_lost.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/scroll.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/side_bar.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/sort.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/swap_line.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/switch_file.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/transform.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/transpose.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Diff/diff.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/HTML/encode_html_entities.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/HTML/html_completions.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/Package Control/Package Control.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/SublimeCodeIntel.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/autobuild.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/autocomplete.py
>>>  ['hdevtools', 'admin', '--status']
>>>  ['ghc-mod', 'lang']
>>>  ['ghc', '--make', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/CabalInspector.hs', '-o', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/CabalInspector', '-outputdir', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/obj/CabalInspector']
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/cabalbuild.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/cache.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/ghci.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/ghcmod.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/haskell_docs.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/haskell_type.py
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "./autocomplete.py", line 707, in run
  File "./autocomplete.py", line 757, in init_ghcmod_completions
    autocompletion.language_completions = call_ghcmod_and_wait(['lang']).splitlines()
  File "./sublime_haskell_common.py", line 388, in call_ghcmod_and_wait
    output_error(sublime.active_window(),
RuntimeError: Must call on main thread, consider using sublime.set_timeout(function, timeout)

>>>  ['ghc', '--make', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/ModuleInspector.hs', '-package', 'ghc', '-o', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/ModuleInspector', '-outputdir', u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/obj/ModuleInspector']
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/hdevtools.py
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./hdevtools.py", line 88, in start_server
    if not is_running():
  File "./hdevtools.py", line 81, in is_running
    r = admin(['--status'], wait = True)
  File "./hdevtools.py", line 72, in admin
    (exit_code, stdout, stderr) = call_and_wait(command, **popen_kwargs)
  File "./sublime_haskell_common.py", line 94, in call_and_wait
  File "./sublime_haskell_common.py", line 137, in call_and_wait_with_input
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

>>>  ['hdevtools', 'admin', '--status']
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/parseoutput.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/stylishhaskell.py
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./hdevtools.py", line 88, in start_server
    if not is_running():
  File "./hdevtools.py", line 81, in is_running
    r = admin(['--status'], wait = True)
  File "./hdevtools.py", line 72, in admin
    (exit_code, stdout, stderr) = call_and_wait(command, **popen_kwargs)
  File "./sublime_haskell_common.py", line 94, in call_and_wait
    return call_and_wait_with_input(command, None, **popen_kwargs)
  File "./sublime_haskell_common.py", line 137, in call_and_wait_with_input
    **popen_kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/sublime_haskell_common.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/symbols.py
Reloading plugin /Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeLinter/SublimeLinter.py
imported capp_lint
imported pep8
imported pyflakes
imported pyflakes.api
imported pyflakes.checker
imported pyflakes.messages
imported pyflakes.reporter
SublimeLinter: C loaded
SublimeLinter: c_cpplint loaded
SublimeLinter: CoffeeScript loaded
SublimeLinter: CSS loaded
SublimeLinter: Git Commit Message loaded
SublimeLinter: Ruby Haml loaded
SublimeLinter: HTML loaded
SublimeLinter: Java loaded
SublimeLinter: JavaScript loaded
SublimeLinter: Lua loaded
SublimeLinter: Annotations loaded
SublimeLinter: Objective-J loaded
SublimeLinter: Perl loaded
SublimeLinter: PHP loaded
SublimeLinter: Puppet loaded
SublimeLinter: Python loaded
SublimeLinter: Ruby loaded
SublimeLinter: pylint loaded
SublimeLinter: XML loaded
plugin init time: 1.47931
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
pre session restore time: 1.73201
using gamma: 1 (err: 0)
startup cache, total files: 109 cache hits: 109
startup time: 1.89587 (package setup was not run)
loaded 844 snippets
Package Control: Skipping automatic upgrade, last run at 2013-03-17 00:28:30, next run at 2013-03-17 01:28:30 or after
Writing file /Users/scott/Code/eq/eqord.hs with encoding UTF-8
Sublime Haskell: reinspecting project (/Users/scott/Code/eq)
>>>  [u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/CabalInspector', u'/Users/scott/Code/eq/eq.cabal']
>>>  [u'/Users/scott/Library/Application Support/Sublime Text 2/Packages/SublimeHaskell/CabalInspector', (u'eq', u'/Users/scott/Code/eq/eq.cabal')]
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "./autocomplete.py", line 902, in run
  File "./autocomplete.py", line 944, in _refresh_all_module_info
  File "./autocomplete.py", line 995, in _refresh_module_info
  File "./sublime_haskell_common.py", line 336, in get_source_dir
  File "./sublime_haskell_common.py", line 94, in call_and_wait
  File "./sublime_haskell_common.py", line 137, in call_and_wait_with_input
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, tuple found

Sublime Haskell: time to get completions: 0.000248 seconds
Sublime Haskell: time to get completions: 9.90000000001e-05 seconds
Sublime Haskell: time to get completions: 0.000367 seconds
Sublime Haskell: time to get completions: 0.00038 seconds
Sublime Haskell: time to get completions: 0.000392 seconds
Sublime Haskell: time to get completions: 0.000362 seconds
Sublime Haskell: time to get completions: 0.000384 seconds
Sublime Haskell: time to get completions: 0.000405 seconds
Sublime Haskell: time to get completions: 0.000345 seconds
Sublime Haskell: time to get completions: 0.000426 seconds
Sublime Haskell: time to get completions: 0.000440999999999 seconds
Sublime Haskell: time to get completions: 0.000194 seconds
Sublime Haskell: time to get completions: 0.000355 seconds
Sublime Haskell: time to get completions: 0.000442 seconds
Sublime Haskell: time to get completions: 0.000455 seconds
Sublime Haskell: time to get completions: 0.0003 seconds
Sublime Haskell: time to get completions: 0.000323 seconds
Sublime Haskell: time to get completions: 0.000313999999999 seconds
Sublime Haskell: time to get completions: 0.000263 seconds
Sublime Haskell: time to get completions: 0.00027 seconds
Sublime Haskell: time to get completions: 0.000266 seconds
Sublime Haskell: time to get completions: 0.000267999999999 seconds
Sublime Haskell: time to get completions: 0.000120000000001 seconds
Sublime Haskell: time to get completions: 0.000132 seconds
Sublime Haskell: time to get completions: 0.000267999999999 seconds
Sublime Haskell: time to get completions: 0.000266 seconds
Sublime Haskell: time to get completions: 0.000262 seconds
Sublime Haskell: time to get completions: 0.00026 seconds
Sublime Haskell: time to get completions: 0.000137 seconds
Sublime Haskell: time to get completions: 0.000123 seconds
Sublime Haskell: time to get completions: 0.000121 seconds
Writing file /Users/scott/Code/eq/eqord.hs with encoding UTF-8
Sublime Haskell: running build commands: [['cabal', 'build'], ['cabal', 'build', '--ghc-options=-fforce-recomp -Wall -fno-code']]
>>>  ['cabal', 'build']
>>>  ['cabal', 'build', '--ghc-options=-fforce-recomp -Wall -fno-code']
Sublime Haskell: total time to mark 0 diagnostics: 0.000555 seconds
Sublime Haskell: time to get completions: 0.000163 seconds
Writing file /Users/scott/Code/eq/eqord.hs with encoding UTF-8
Sublime Haskell: running build commands: [['cabal', 'build'], ['cabal', 'build', '--ghc-options=-fforce-recomp -Wall -fno-code']]
>>>  ['cabal', 'build']
>>>  ['cabal', 'build', '--ghc-options=-fforce-recomp -Wall -fno-code']
Sublime Haskell: total time to mark 0 diagnostics: 0.000473 seconds

At least one of the above is caused by sublime not having ghc on the $PATH (osx doesnt have /usr/bin on $PATH apparently, though I do in the terminal).

Owner

nh2 commented Mar 17, 2013

Sublime tends to not care too much about what is in your terminal PATH. Have a look at our add_to_PATH setting.

I don't have an OS X system - maybe we should set this to some default? Any recommendations?

Contributor

kolmodin commented Mar 17, 2013

I found and fixed this bug yesterday in pull request #34.

Owner

nh2 commented Mar 18, 2013

@ssadler Is this fixed?

Contributor

kolmodin commented Apr 1, 2013

I'm confident this is the same issue as #34. I suggest we close this issue.

Owner

nh2 commented Aug 24, 2013

@ssadler Please reopen if this is still an issue for you.

@nh2 nh2 closed this Aug 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment