sublime-rsync-ssh icon indicating copy to clipboard operation
sublime-rsync-ssh copied to clipboard

Decoding output of remote_post_command sometimes fails

Open Ch00k opened this issue 9 years ago • 2 comments

I have the remote_post_command defined and set to make and the plugin sometimes fails to parse the output of my make command with the following exception:

Exception in thread Thread-8:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "rsync_ssh in /Users/ay/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 581, in run
  File "rsync_ssh in /Users/ay/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 43, in check_output
  File "./subprocess.py", line 578, in check_output
  File "./subprocess.py", line 915, in communicate
  File "./subprocess.py", line 479, in _eintr_retry_call
  File "./encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 117: ordinal not in range(128)

UPD In fact this is easily reproducible by setting the remote_post_command to this: echo '‘'

Ch00k avatar Oct 04 '15 08:10 Ch00k

Hi any update on this,

Sublime: v3.0, Build: 3143 Rsync SSH: v1.7.1

[rsync-ssh] s1.example.com[splunktools]: rsync -v -zar -e ssh -q -T -o ConnectTimeout=10 -p 22 --delete --no-perms --chmod=ugo=rwX /Users/Git-Repos/splunktools/ [email protected]:'/tmp/sublime-projects/splunktools' --exclude=*log/ --exclude=_build --exclude=Build --exclude=blib --exclude=.git* --exclude=.DS_Store --exclude=*_local*
Exception in thread Thread-3098:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "rsync_ssh in /Users/deepakk/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 567, in run
  File "rsync_ssh in /Users/deepakk/Library/Application Support/Sublime Text 3/Installed Packages/Rsync SSH.sublime-package", line 43, in check_output
  File "./python3.3/subprocess.py", line 578, in check_output
  File "./python3.3/subprocess.py", line 907, in communicate
  File "./python3.3/subprocess.py", line 479, in _eintr_retry_call
  File "./python3.3/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)

[rsync-ssh] done

deepak-kosaraju avatar Mar 14 '18 01:03 deepak-kosaraju

I'd suggest introducing a global option for encodings and allow overriding that encoding for the different stages (pre/post/...)

An alternative would be to change/configure the environment variables LC_ALL or LC_LANG to cause predictable output. Or both.

Thoughts, @davidolrik ?

ctheune avatar Sep 08 '23 13:09 ctheune