diff --git a/news/45.bugfix b/news/45.bugfix new file mode 100644 index 0000000..37feb95 --- /dev/null +++ b/news/45.bugfix @@ -0,0 +1,2 @@ +Fix ValueError when calling ``bin/manage launchpad 5.2.10.1``. +[maurits] diff --git a/plone/releaser/manage.py b/plone/releaser/manage.py index d4cad5b..55163ad 100644 --- a/plone/releaser/manage.py +++ b/plone/releaser/manage.py @@ -123,7 +123,14 @@ def changelog(**kwargs): def create_launchpad_release(version): launchpad = Launchpad.login_with("plone.releaser", "production") plone = launchpad.projects["plone"] - parsed_version = StrictVersion(version) + try: + parsed_version = StrictVersion(version) + except ValueError: + # ValueError: invalid version number '5.2.10.1' + if version.count(".") < 3: + raise + adapted_version = ".".join(version.split(".")[:3]) + parsed_version = StrictVersion(adapted_version) # Blech. This feels flimsy series_name = ".".join([str(a) for a in parsed_version.version[0:2]]) series = plone.getSeries(name=series_name)