Store empty string for release

If we're unable to extract the project version from the package, we
leave things unversioned. Unfortunately, that means setting the
'version' and 'release' config options to 'None'. These should be
strings and setting them to 'None' results in the following errors:

  WARNING: The config value `release' has type `NoneType', defaults to `str'.
  ...

  Exception occurred:
    File ".../sphinx/builders/html/__init__.py", line 475, in prepare_writing
      'release': return_codes_re.sub('', self.config.release),
  TypeError: expected string or bytes-like object

Simply set an empty string instead.

Change-Id: I6df4a90b04f3ed89c69fb7669027feda6c5ffe79
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1896609
This commit is contained in:
Stephen Finucane 2020-09-22 11:07:37 +01:00
parent 9efc192021
commit 6876b7276b
1 changed files with 1 additions and 1 deletions

View File

@ -420,7 +420,7 @@ def _config_inited(app, config):
try:
project_version = packaging.get_version(real_project_name)
except Exception:
project_version = None
project_version = ''
if not project_version:
logger.warning(