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

Error in date format #1647

Open
shimizukawa opened this Issue Jan 3, 2015 · 20 comments

Comments

Projects
None yet
5 participants
@shimizukawa
Member

shimizukawa commented Jan 3, 2015

Exception occurred:
File "/usr/local/src/faunalia-website/_templates/layout.html", line 118, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format

From conf.py:

html_last_updated_fmt = '%d %b %Y'

Thanks.


@shimizukawa shimizukawa added the bug label Jan 3, 2015

@shimizukawa

This comment has been minimized.

Show comment
Hide comment
@shimizukawa

shimizukawa Jan 3, 2015

Member

From pcav on 2014-12-06 18:40:05+00:00

Apparently this prevents compilation for fr locale, so it's rather serious.
May be my mistake, I apologize in advance.

Member

shimizukawa commented Jan 3, 2015

From pcav on 2014-12-06 18:40:05+00:00

Apparently this prevents compilation for fr locale, so it's rather serious.
May be my mistake, I apologize in advance.

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Jan 5, 2016

Member

I can't reproduce this.
I tried with combination of these parameters:

  • language = 'fr' in conf.py
  • environment variable LANG=fr
  • environment variable LANG=fr_FR.utf-8

Could you tell me your settings and environment in detail?

Member

tk0miya commented Jan 5, 2016

I can't reproduce this.
I tried with combination of these parameters:

  • language = 'fr' in conf.py
  • environment variable LANG=fr
  • environment variable LANG=fr_FR.utf-8

Could you tell me your settings and environment in detail?

@shimizukawa

This comment has been minimized.

Show comment
Hide comment
@shimizukawa

shimizukawa Jan 20, 2016

Member

@pcav do you still have this issue?

Member

shimizukawa commented Jan 20, 2016

@pcav do you still have this issue?

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Jan 20, 2016

Yes, with 1.3.4

Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format

pcav commented Jan 20, 2016

Yes, with 1.3.4

Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format

@shimizukawa

This comment has been minimized.

Show comment
Hide comment
@shimizukawa

shimizukawa Jan 23, 2016

Member

@pcav Please try below command (-P for debugging mode when exception is occurred)

> sphinx-build -M html . _build -P
...
Exception occurred while building, starting debugger:
...
(Pdb) from sphinx import locale
(Pdb) locale.mygettext('Last updated on %(last_updated)s.')
u'Mis \xe0 jour le %(last_updated)s.'

I suspect that the translated string (last line) is broken.

Member

shimizukawa commented Jan 23, 2016

@pcav Please try below command (-P for debugging mode when exception is occurred)

> sphinx-build -M html . _build -P
...
Exception occurred while building, starting debugger:
...
(Pdb) from sphinx import locale
(Pdb) locale.mygettext('Last updated on %(last_updated)s.')
u'Mis \xe0 jour le %(last_updated)s.'

I suspect that the translated string (last line) is broken.

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Jul 25, 2016

Member

Ping, any updates?

Member

tk0miya commented Jul 25, 2016

Ping, any updates?

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Jul 26, 2016

Yes, still the same, with:
html_last_updated_fmt = '%d %b %Y' in conf.py

{{{
Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format
The full traceback has been saved in /tmp/sphinx-err-VnZIoQ.log, if you want to report the issue to the developers.
}}}

pcav commented Jul 26, 2016

Yes, still the same, with:
html_last_updated_fmt = '%d %b %Y' in conf.py

{{{
Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format
The full traceback has been saved in /tmp/sphinx-err-VnZIoQ.log, if you want to report the issue to the developers.
}}}

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Jul 26, 2016

Member

@pcav Thanks. Could you check the shimizukawa's comment?
We need more detailed information using debugging mode.

Member

tk0miya commented Jul 26, 2016

@pcav Thanks. Could you check the shimizukawa's comment?
We need more detailed information using debugging mode.

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Jul 26, 2016

sphinx-build -M html . _build -P does not throw an error.

pcav commented Jul 26, 2016

sphinx-build -M html . _build -P does not throw an error.

@shirou

This comment has been minimized.

Show comment
Hide comment
@shirou

shirou Jul 28, 2016

Contributor

I cloned https://github.com/pcav/faunalia-website, add html_last_updated_fmt = '%d %b %Y' on conf.py, and make html. But no exception occurred.

Sphinx==1.3.4
sphinx-bootstrap-theme==0.4.12

2016-07-28 21 34 43

Contributor

shirou commented Jul 28, 2016

I cloned https://github.com/pcav/faunalia-website, add html_last_updated_fmt = '%d %b %Y' on conf.py, and make html. But no exception occurred.

Sphinx==1.3.4
sphinx-bootstrap-theme==0.4.12

2016-07-28 21 34 43

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Jul 28, 2016

I use sphinx 1.4.
Thanks for testing.

pcav commented Jul 28, 2016

I use sphinx 1.4.
Thanks for testing.

@shirou

This comment has been minimized.

Show comment
Hide comment
@shirou

shirou Jul 28, 2016

Contributor

I also checked with sphinx 1.4.0 and 1.4.5, but same as no exception.
What is your locale on your terminal and your os or distribution?

Contributor

shirou commented Jul 28, 2016

I also checked with sphinx 1.4.0 and 1.4.5, but same as no exception.
What is your locale on your terminal and your os or distribution?

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Jul 28, 2016

it_IT.UTF-8 UTF-8
Debian sid

pcav commented Jul 28, 2016

it_IT.UTF-8 UTF-8
Debian sid

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Aug 7, 2016

Member

sphinx-build -M html . _build -P does not throw an error.

Hmm, it's strange...
Do you get the errors if you remove -P option from this command line?
If not, please add -P option to the command line which raises errors.

Member

tk0miya commented Aug 7, 2016

sphinx-build -M html . _build -P does not throw an error.

Hmm, it's strange...
Do you get the errors if you remove -P option from this command line?
If not, please add -P option to the command line which raises errors.

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Aug 8, 2016

sphinx-build -M html . _build does not throw an error.
make html does:

{{{
Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format
}}}

My Make:

{{{
html:
@for lang in $(LANGUAGES);
do
mkdir -p $(BUILDDIR)/html/$(SOURCE)/$$lang $(BUILDDIR)/doctrees/$(SOURCE)/$$lang;
echo "$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCE) $(BUILDDIR)/html/$$lang";
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCE) $(BUILDDIR)/html/$(SOURCE)/$$lang;
}}}

Thanks

pcav commented Aug 8, 2016

sphinx-build -M html . _build does not throw an error.
make html does:

{{{
Exception occurred:
File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}


ValueError: incomplete format
}}}

My Make:

{{{
html:
@for lang in $(LANGUAGES);
do
mkdir -p $(BUILDDIR)/html/$(SOURCE)/$$lang $(BUILDDIR)/doctrees/$(SOURCE)/$$lang;
echo "$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCE) $(BUILDDIR)/html/$$lang";
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCE) $(BUILDDIR)/html/$(SOURCE)/$$lang;
}}}

Thanks

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Aug 9, 2016

Member

I understand. You use custom Makefile and give -Dlanguage=$$lang option on buliding docs.
Surely, sphinx-build -M html . _build does not raise errors.

Could you add -P to $ALLSPHINXOPTS?
It would be raise errors.

Member

tk0miya commented Aug 9, 2016

I understand. You use custom Makefile and give -Dlanguage=$$lang option on buliding docs.
Surely, sphinx-build -M html . _build does not raise errors.

Could you add -P to $ALLSPHINXOPTS?
It would be raise errors.

@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Aug 10, 2016

Exception occurred while building, starting debugger:                                                                  
Traceback (most recent call last):
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/application.py", line 287, in build
    self.builder.build_update()
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 251, in build_update
    'out of date' % len(to_build))
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 360, in write
    self._write_serial(sorted(docnames), warnings)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 368, in _write_serial
    self.write_doc(docname, doctree)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 451, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 802, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/jinja2glue.py", line 138, in render
    return self.environment.get_template(template).render(context)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 39, in top-level template code
    {% block languageswitch %}
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx_bootstrap_theme/bootstrap/layout.html", line 81, in top-level template code
    {%- include sidebartemplate %}
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/themes/basic/layout.html", line 185, in top-level template code
    {%- block footer %}
  File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
    {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/><br/>
ValueError: incomplete format
> /usr/local/src/pcav/faunalia-website/_templates/layout.html(107)block "footer"()
-> {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/><br/>

pcav commented Aug 10, 2016

Exception occurred while building, starting debugger:                                                                  
Traceback (most recent call last):
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/application.py", line 287, in build
    self.builder.build_update()
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 251, in build_update
    'out of date' % len(to_build))
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 360, in write
    self._write_serial(sorted(docnames), warnings)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 368, in _write_serial
    self.write_doc(docname, doctree)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 451, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 802, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/jinja2glue.py", line 138, in render
    return self.environment.get_template(template).render(context)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 39, in top-level template code
    {% block languageswitch %}
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx_bootstrap_theme/bootstrap/layout.html", line 81, in top-level template code
    {%- include sidebartemplate %}
  File "/usr/local/src/py_virtual_stable/local/lib/python2.7/site-packages/sphinx/themes/basic/layout.html", line 185, in top-level template code
    {%- block footer %}
  File "/usr/local/src/pcav/faunalia-website/_templates/layout.html", line 107, in block "footer"
    {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/><br/>
ValueError: incomplete format
> /usr/local/src/pcav/faunalia-website/_templates/layout.html(107)block "footer"()
-> {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/><br/>
@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Aug 10, 2016

Member

Okay, you succeeded to catch the error by pdb.
Could you run following commands (which starts with "(Pdb)") as shimizukawa said and let us know its results?

(Pdb) from sphinx import locale
(Pdb) locale.mygettext('Last updated on %(last_updated)s.')
u'Mis \xe0 jour le %(last_updated)s.'
Member

tk0miya commented Aug 10, 2016

Okay, you succeeded to catch the error by pdb.
Could you run following commands (which starts with "(Pdb)") as shimizukawa said and let us know its results?

(Pdb) from sphinx import locale
(Pdb) locale.mygettext('Last updated on %(last_updated)s.')
u'Mis \xe0 jour le %(last_updated)s.'
@pcav

This comment has been minimized.

Show comment
Hide comment
@pcav

pcav Aug 10, 2016

(Pdb) from sphinx import locale
/usr/local/src/pcav/faunalia-website/_templates/layout.html:1: RuntimeWarning: Parent module '/usr/local/src/pcav/faunalia-website/_templates/layout' not found while handling absolute import
  {# Import the theme's layout. #}
u'Mis \xe0 jour en %(last_updated).'

So it's French.
Thanks.

pcav commented Aug 10, 2016

(Pdb) from sphinx import locale
/usr/local/src/pcav/faunalia-website/_templates/layout.html:1: RuntimeWarning: Parent module '/usr/local/src/pcav/faunalia-website/_templates/layout' not found while handling absolute import
  {# Import the theme's layout. #}
u'Mis \xe0 jour en %(last_updated).'

So it's French.
Thanks.

@takuan-osho

This comment has been minimized.

Show comment
Hide comment
@takuan-osho

takuan-osho Jan 7, 2018

Contributor

I cloned https://github.com/pcav/faunalia-website, add html_last_updated_fmt = '%d %b %Y' and language = 'fr' in conf.py, and make html with -P in $ALLSPHINXOPTS. But no exception occurred.

The versions of sphinx and extension are here:

Sphinx==1.3.4
sphinx-bootstrap-theme==0.6.0

In the case of sphinx 1.6.5, there is no exception occurred too.

Contributor

takuan-osho commented Jan 7, 2018

I cloned https://github.com/pcav/faunalia-website, add html_last_updated_fmt = '%d %b %Y' and language = 'fr' in conf.py, and make html with -P in $ALLSPHINXOPTS. But no exception occurred.

The versions of sphinx and extension are here:

Sphinx==1.3.4
sphinx-bootstrap-theme==0.6.0

In the case of sphinx 1.6.5, there is no exception occurred too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment