davidolrik / sublime-rsync-ssh

Keep remote directories in sync with local projects.
75 stars 33 forks source link

Decoding output of remote_post_command sometimes fails #33

Open Ch00k opened 9 years ago

Ch00k commented 9 years ago

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 '‘'

deepak-kosaraju commented 6 years ago

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/ user@s1.example.com:'/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
ctheune commented 1 year ago

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 ?