bump2version
bump2version copied to clipboard
TypeError: 'NoneType' object is not iterable`
When executing I get the following error:
$ bump2version part minor --new-version 4.11.0
Traceback (most recent call last):
File "/usr/local/bin/bump2version", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/bumpversion/cli.py", line 107, in main
_check_files_contain_version(files, current_version, context)
File "/usr/local/lib/python2.7/dist-packages/bumpversion/cli.py", line 587, in _check_files_contain_version
f.should_contain_version(current_version, context)
File "/usr/local/lib/python2.7/dist-packages/bumpversion/utils.py", line 46, in should_contain_version
context["current_version"] = self._versionconfig.serialize(version, context)
File "/usr/local/lib/python2.7/dist-packages/bumpversion/version_part.py", line 282, in serialize
version, self._choose_serialize_format(version, context), context
File "/usr/local/lib/python2.7/dist-packages/bumpversion/version_part.py", line 262, in _choose_serialize_format
version, serialize_format, context, raise_if_incomplete=True
File "/usr/local/lib/python2.7/dist-packages/bumpversion/version_part.py", line 205, in _serialize
for k in version:
TypeError: 'NoneType' object is not iterable
Never mind found the issue, command should be: $ bump2version --current-version 4.11.0 --new-version 4.12.0 minor
2 remarks:
- to my opinion a wrong syntax should never print a stacktrace
- --current-version is a required option, which it should only be during initialisation
I agree. The method needs a if not current_version
with the proper error message (Failed to detect current version
or similar). Would you be willing to provide a patch?
About my second remark: I found out my mistake. I should create a .bumpversion.cfg file. RTFM ... :-)
@ekohl I'm not a python dev, but I can have a look
Stumbled over the same issue right now...
In my case, I was just not in the toplevel project directory, but in ./docs ...
I have the same error as well. We must solve this as soon as possible!