Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building docs fails with Sphinx 7.2 and SOURCE_DATE_EPOCH environment variable #275

Open
s3v- opened this issue Nov 10, 2023 · 0 comments
Open

Comments

@s3v-
Copy link

s3v- commented Nov 10, 2023

Hi,
Currently your package fails to build from source in Debian with Sphinx 7.2:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042586
The failure is caused by SOURCE_DATE_EPOCH environment variable added during build in Debian.
Please see here and here for reference.

Step to reproduce:

$ export SOURCE_DATE_EPOCH=1699611891; sphinx-build -b html python-flask-marshmallow-0.15.0/docs/ .

Running Sphinx v7.2.6
WARNING: html_static_path entry '_static' is placed inside outdir

Extension error (sphinx.config):
Handler <function correct_copyright_year at 0x7fd7fe000ae0> for event 'config-inited' threw an exception (exception: string index out of range)

Offending lines:

copyright = "2014-{:%Y}".format(
dt.datetime.utcfromtimestamp(os.path.getmtime("../CHANGELOG.rst"))
)

This change solves the issue:

copyright = "2014-{:%Y}, something".format(
    dt.datetime.utcfromtimestamp(os.path.getmtime("../CHANGELOG.rst"))
)

Kind Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant