zsquareplusc / mpy-repl-tool

Yet an other tool to transfer files, execute files and so on via the Python prompt, used for MicroPython
Other
19 stars 5 forks source link

"there" appears to be broken on OSX #1

Closed hoihu closed 7 years ago

hoihu commented 7 years ago

using version as of now (5.1.) and latest pull of pyserial. Installed using python3 setup.py develop.

symptom:

$ python3 -m there -i
ERROR: action or command failed: <lambda>() takes 2 positional arguments but 3 were given
--- Patched Miniterm-MPY on /dev/cu.usbmodem14112  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

MicroPython v1.8.5-255-ga081b49 on 2016-11-25; LIMIFROG with STM32L476
Type "help()" for more information.
>>> 
--- exit ---
$ python3 -m there ls
ERROR: action or command failed: [Errno 19] OSError
$ python3 -m there cat main.py
ERROR: action or command failed: write() argument must be str, not bytes
$ python3 -m there cat /flash/main.py
ERROR: action or command failed: write() argument must be str, not bytes
$ 

So the only thing that works for me at the moment is the REPL...

zsquareplusc commented 7 years ago

running with -develop will give full tracebacks that make debugging easier.

hoihu commented 7 years ago
$ python3 -m there cat main.py --develop
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 417, in <module>
    main()
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 396, in main
    args.func(user, m, args)
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 137, in command_cat
    user.output(m.read_from_file(args.PATH))
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 30, in output
    sys.stdout.write(message)
TypeError: write() argument must be str, not bytes
$ 

and

$ python3 -m there -i --develop
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 417, in <module>
    main()
  File "/Users/martin/projects/github/mpy-repl-tool/there/__main__.py", line 396, in main
    args.func(user, m, args)
TypeError: <lambda>() takes 2 positional arguments but 3 were given
hoihu commented 7 years ago

Thanks! Fixed it.