Skip to content

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

@timothyfroehlich

Description

@timothyfroehlich

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 '

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions