Version throws error
Closed this issue · 4 comments
Installed with pip 9.0.1, python 2.7. Nice tool, would like to use in my pipeline for Minion.
$ NanoStat -v
Traceback (most recent call last):
File "/usr/bin/NanoStat", line 11, in <module>
sys.exit(main())
File "/usr/lib64/python2.7/site-packages/nanostat/NanoStat.py", line 62, in main
args = get_args()
File "/usr/lib64/python2.7/site-packages/nanostat/NanoStat.py", line 139, in get_args
return parser.parse_args()
File "/usr/lib64/python2.7/argparse.py", line 1688, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "/usr/lib64/python2.7/argparse.py", line 1720, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/usr/lib64/python2.7/argparse.py", line 1926, in _parse_known_args
start_index = consume_optional(start_index)
File "/usr/lib64/python2.7/argparse.py", line 1866, in consume_optional
take_action(action, args, option_string)
File "/usr/lib64/python2.7/argparse.py", line 1794, in take_action
action(self, namespace, argument_values, option_string)
File "/usr/lib64/python2.7/argparse.py", line 1020, in __call__
parser.exit(message=formatter.format_help())
File "/usr/lib64/python2.7/argparse.py", line 279, in format_help
help = self._root_section.format_help()
File "/usr/lib64/python2.7/argparse.py", line 209, in format_help
func(*args)
File "/usr/lib64/python2.7/argparse.py", line 483, in _format_text
return self._fill_text(text, text_width, indent) + '\n\n'
File "/usr/lib64/python2.7/site-packages/nanostat/NanoStat.py", line 50, in _fill_text
return ''.join(indent + line for line in text.splitlines(keepends=True))
TypeError: splitlines() takes no keyword arguments
Hi,
Thanks for reporting this, I'll have a look at your issue tomorrow (which is in 8 hours). My first guess is that this is because of Python 2.7, as I write and test for Python3 only. Scripts may or may not be compatible. I should add that in the README, seems I forgot that for this tool.
Cheers,
Wouter
I can confirm this is due to Python2.7, which I do not plan to support. It's not just this error, there would be other issues when I fix this one. Is there a reason you cannot use Python3?
Ok, thanks for looking into it. I can and will now use Python3. I used Python2.7 because I wrongly assumed, not knowing much about Python, that 'pip' is for 2.7, 'pip3' is for 3. So following install instructions, I used 2.7. Glad to clarify and know it should work on 3.
Please let me know if you have any further questions or suggestions.