mitranim / sublime-rust-fmt

Sublime Text plugin that formats Rust code with rustfmt
30 stars 3 forks source link

Command fails on non-ascii input #1

Closed urschrei closed 7 years ago

urschrei commented 7 years ago

How to reproduce: include a non-ascii character in your source file. Error:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "RustFmt in /Users/sth/Dropbox/Sublime Text 3/Installed Packages/RustFmt.sublime-package", line 80, in run
  File "RustFmt in /Users/sth/Dropbox/Sublime Text 3/Installed Packages/RustFmt.sublime-package", line 46, in run_format
  File "./python3.3/subprocess.py", line 920, in communicate
    if _mswindows:
  File "./python3.3/subprocess.py", line 1556, in _communicate
    elif _WIFEXITED(sts):
  File "./python3.3/subprocess.py", line 1629, in _communicate_with_poll
    while True:
  File "./python3.3/subprocess.py", line 1590, in _save_input
    # can't get the status.
UnicodeEncodeError: 'ascii' codec can't encode character '\u2728' in position 3909: ordinal not in range(128)
mitranim commented 7 years ago

Good catch. Just pushed a fix. Please update the plugin and try again.

urschrei commented 7 years ago

Working now. Thank you!