You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use "ly indent" from vim as an external command. Essentially using the built-in stdin/stdout functionality of ly like this: cat music.ly | ly indent
However, I get a Python error when I try
Traceback (most recent call last):
File "/usr/local/bin/ly", line 4, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/ly/cli/main.py", line 262, in main
opts, commands, files = parse_command_line()
File "/Library/Python/2.7/site-packages/ly/cli/main.py", line 185, in parse_command_line
for arg in args:
File "/Library/Python/2.7/site-packages/ly/cli/main.py", line 172, in <genexpr>
args = (a.decode(sys.stdin.encoding) for a in sys.argv[1:])
TypeError: decode() argument 1 must be string, not None
The normal command line functionality works: ly indent music.ly -o music.ly
I'm using the latest python-ly that pip installs, 0.9.2.
Am I missing something on the command line, or is this a bug?
Patrick
The text was updated successfully, but these errors were encountered:
patrickgardella
changed the title
Command line use of "ly indent"
Use of "ly indent" via stdin/out
Nov 13, 2015
Thanks for reporting! This is indeed a bug. The code erroneously assumes that sys.stdin.encoding always returns a valid encoding name (on my system it is 'UTF-8').
When piping input from a file, the encoding attribute is None and this code fails in parsing command line arguments.
I am trying to use "ly indent" from vim as an external command. Essentially using the built-in stdin/stdout functionality of ly like this:
cat music.ly | ly indent
However, I get a Python error when I try
The normal command line functionality works:
ly indent music.ly -o music.ly
I'm using the latest python-ly that pip installs, 0.9.2.
Am I missing something on the command line, or is this a bug?
Patrick
The text was updated successfully, but these errors were encountered: