G-Node / nixpy

Python library for NIX
https://readthedocs.org/projects/nixpy
Other
19 stars 26 forks source link

Error upgrading file on py3.6 #518

Closed matham closed 3 years ago

matham commented 3 years ago

I was testing upgrading a file from 1.4.9 on a Python 3.6 installation and I got the following error:

python_venv) D:\PNN project\6-23-21>nixio upgrade 6-23-21___slice2_merged.h5
Traceback (most recent call last):
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python36\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python36\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\python_venv\Scripts\nixio.exe\__main__.py", line 7, in <module>
  File "c:\python_venv\lib\site-packages\nixio\cmd\main.py", line 20, in main
    dest="cmd")
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python36\Lib\argparse.py", line 1707, in add_subparsers
    action = parsers_class(option_strings=[], **kwargs)
TypeError: __init__() got an unexpected keyword argument 'required'

Since the installation instructions say it's supporting 3.6, I figure I should open an issue. I fixed it locally temporarily by removing the required argument. https://github.com/pkoenig10/sink/issues/16#issuecomment-421830751 explains the source of the issue though.

jgrewe commented 3 years ago

As I understand the required argument is used here to indicate that one of the sub-commands has to be selected (added in 3.7) and . @achilleas-k do we loose something by simply removing it (for now)?

achilleas-k commented 3 years ago

I think we can drop it. Not sure what the behaviour will be. I think by having it, the command defaults to printing help when nothing is provided. But if we want to keep 3.6 compat, we should remove it regardless.