Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quotation marks aren't being detected properly within the iotile cmdline on Windows #940

Open
timothyfroehlich opened this issue Jan 16, 2020 · 1 comment

Comments

@timothyfroehlich
Copy link
Contributor

timothyfroehlich commented Jan 16, 2020

On Windows (The LabPC), using PowerShell, and tried to force a proxy when connecting to the controller of my Access Point. Here's the command and error:

(venv) PS C:\Users\LabUser\tfroehlich> iotile hw --port=bled112
(HardwareManager) connect 0x12d2
(HardwareManager) get 8 --force='NRF52 '
Traceback (most recent call last):
  File "c:\users\labuser\tfroehlich\venv\lib\site-packages\iotile\core\scripts\iotile_script.py", line 244, in main
    finished = shell.invoke_string(linebuf)
  File "c:\users\labuser\tfroehlich\venv\lib\site-packages\typedargs\shell.py", line 517, in invoke_string
    args = self._split_line(line)
  File "c:\users\labuser\tfroehlich\venv\lib\site-packages\typedargs\shell.py", line 136, in _split_line
    parts = shlex.split(line, posix=self.posix_lex)
  File "C:\Users\LabUser\tfroehlich\python3.7\Lib\shlex.py", line 310, in split
    return list(lex)
  File "C:\Users\LabUser\tfroehlich\python3.7\Lib\shlex.py", line 299, in __next__
    token = self.get_token()
  File "C:\Users\LabUser\tfroehlich\python3.7\Lib\shlex.py", line 109, in get_token
    raw = self.read_token()
  File "C:\Users\LabUser\tfroehlich\python3.7\Lib\shlex.py", line 191, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation
(HardwareManager)

The same command sequence worked fine on my Linux PC :

$ iotile hw 
(HardwareManager) connect 42
(HardwareManager) get 8 --force='NRF52 '
(NRF52832Controller)

The windows test was with Python 3.7 and I got the same results with the Python test with both Python 3.7 and 3.5.

The workaround is to get the proxy from an initial command line invocation, which works properly.
iotile hw --port=bled112 connect 0x12d2 get 8 --force='NRF52 '

@timburke
Copy link
Member

timburke commented Jan 16, 2020

@timothyfroehlich Another workaround that should work is to quote the entire command line argument:

get 8 "--force=NRF52 "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants