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

When building a site with multiple date_formats, Nikola sometimes crashes and others it messes up the formats #2332

Closed
sukiletxe opened this issue May 3, 2016 · 14 comments
Assignees
Labels
Milestone

Comments

@sukiletxe
Copy link
Contributor

My site source: https://github.com/sukiletxe/sukiletxe.github.io/tree/src
Some more data to track down the issue:

Note: Is it necessary to use calendar.different_locale? This may be causing the issue...

@sukiletxe
Copy link
Contributor Author

Hello,
So I tried to build the site with just one date_format, and it still fails.

Traceback here. Here is the output generated with the previous script.

@ralsina ralsina added this to the v7.7.9 milestone Jun 4, 2016
@ralsina ralsina self-assigned this Jun 4, 2016
@ralsina
Copy link
Member

ralsina commented Jun 4, 2016

That repo is missing a conf.py, so I tried with the defult one, except setting

DATE_FORMAT = '%Y-%m-%d'

And it worked. So wither it's something in your config I don't know about, or it's windows specific.

@sukiletxe
Copy link
Contributor Author

It does have a conf.py, see https://github.com/sukiletxe/sukiletxe.github.io/blob/src/conf.py .

Actually, I suspect the issue may be due to archives rather than dates, because of my previous comment. I'll test later and report back. I'll also try to test on Linux.

@sukiletxe
Copy link
Contributor Author

I've just tried on a Linux machine (specifically Ubuntu Mate), and there
were no tracebacks, but when previewing the formats were messed up.
Like, for example, in Spanish the one used for Basque was displayed.

Seeing my previous logs, it doesn't surprise me that in Linux there were
no tracebacks, because something tries to change the locale into a Linux
compatible one. Therefore, only Windows crashes.

El 04/06/2016 a las 2:59, Roberto Alsina escribió:

That repo is missing a conf.py, so I tried with the defult one, except
setting

|DATE_FORMAT = '%Y-%m-%d' |

And it worked. So wither it's something in your config I don't know
about, or it's windows specific.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2332 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHG-oYQSIMO4ZMN7r2xGGw9gwB_KXdI_ks5qIM3YgaJpZM4IWdy5.

@ralsina
Copy link
Member

ralsina commented Jun 6, 2016

If you could provide steps to reproduce this, and what I should look for in the output, much appreciated.

@sukiletxe
Copy link
Contributor Author

After cloning the repository and checking out the src branch, run nikola build several times, checking the output and the generated site after each one.

If you are using Linux (probably any *Nix operating system), you won't get any errors, but the dates will sometimes be messed up (i. e. the DATE_FORMAT of another language will be used instead of the one for the current language).

On the other hand, if you are using Windows, in addition to this problem, a traceback will eventually show up like the one posted above. The reason for that is that somehow an Unix-like locale is passed to locale.setlocale, and it complains when trying to query a month name.

This also happens with archives, if monthly or full archives are selected. Again, only on Windows.

@Kwpolska Kwpolska modified the milestones: v7.7.9, v7.8.0 Jun 11, 2016
@ralsina
Copy link
Member

ralsina commented Jun 12, 2016

@sukiletxe I have no idea what "the dates will sometimes be messed up". If you could create a small sample showing the failures, and describe what the failure is, it's much easier for me.

@sukiletxe
Copy link
Contributor Author

My site has currently three date formats:

DATE_FORMAT ={
    'default_lang': '%A, %d de %B de %Y %H:%M',
    'en': '%A, %B %d %Y %H:%M',
    'eu': '%A, %Y(e)ko %Bk %d %H:%M',
}

Which would render, for example:

  • DEFAULT_LANG: Sábado, 19 de marzo de 2016 01:16
  • en: Saturday, March 1 2016 01:16
  • eu: Larunbata, 2016(e)ko martxoak 16 01:16

But this is rendered instead in one of the builds in the Spanish subsite:

sábado, 2016(e)ko marzok 19 01:16

And in another one:

sábado, marzo 19 2016 01:16

These results were all gathered using Windows.

It would seem that only the default language is affected, but this showed up in Linux, in the English subsite:

Saturday, 2016(e)ko Marchk 19 01:16

Maybe this is not important, but in every build, the tags were rendered, although they weren't changed.

@ralsina, is there anything else I can do to try to isolate the problem?

@ralsina
Copy link
Member

ralsina commented Jun 12, 2016

Ok, I'll take a look today, maybe.

On Sun, Jun 12, 2016 at 7:05 AM Sukil Etxenike notifications@github.com
wrote:

My site has currently three date formats:

DATE_FORMAT ={
'default_lang': '%A, %d de %B de %Y %H:%M',
'en': '%A, %B %d %Y %H:%M',
'eu': '%A, %Y(e)ko %Bk %d %H:%M',
}

Which would render, for example:

  • DEFAULT_LANG: Sábado, 19 de marzo de 2016 01:16
  • en: Saturday, March 1 2016 01:16
  • eu: Larunbata, 2016(e)ko martxoak 16 01:16

But this is rendered instead in one of the builds in the Spanish subsite:

sábado, 2016(e)ko marzok 19 01:16

And in another one:

sábado, marzo 19 2016 01:16

These results were all gathered using Windows.

It would seem that only the default language is affected, but this showed
up in Linux, in the English subsite:

Saturday, 2016(e)ko Marchk 19 01:16

Maybe this is not important, but in every build, the tags were rendered,
although they weren't changed.

@ralsina https://github.com/ralsina, is there anything else I can do to
try to isolate the problem?


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#2332 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAAGK4x-OYfXRnzQT8ztSdtJrWyoAYsaks5qK9n7gaJpZM4IWdy5
.

@ralsina
Copy link
Member

ralsina commented Jun 23, 2016

@sukiletxe there is a problem in your example config. "default_lang" is not a valid language.
What you could use there is DEFAULT_LANG (uppercase, no quotes) which is a variable set earlier in conf.py.

If you really have "default_lang" there I suspect that could cause many if not all the symptoms you see.

@sukiletxe
Copy link
Contributor Author

Me bad. I didn't notice. Thank you very much. Seems that the
interchanging of formats is fixed, but not the Windows traceback.

El 23/06/2016 a las 2:51, Roberto Alsina escribió:

@sukiletxe https://github.com/sukiletxe there is a problem in your
example config. "default_lang" is not a valid language.
What you could use there is DEFAULT_LANG (uppercase, no quotes) which
is a variable set earlier in conf.py.

If you really have "default_lang" there I suspect that could cause
many if not all the symptoms you see.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2332 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHG-oRjLj3nvRMRMFFoZsv0pctDTZMcpks5qOdiLgaJpZM4IWdy5.

@ralsina
Copy link
Member

ralsina commented Jul 18, 2016

Ok, so this is now Windows-only

@ralsina ralsina modified the milestones: v7.7.10, 7.7.11 Jul 20, 2016
@sukiletxe
Copy link
Contributor Author

That's right.

@Kwpolska Kwpolska modified the milestones: v7.7.12, v7.7.13 Aug 5, 2016
@Kwpolska Kwpolska removed this from the v7.7.12 milestone Aug 5, 2016
@ralsina ralsina added the bug label Aug 18, 2016
@ralsina
Copy link
Member

ralsina commented Aug 20, 2016

Since I don't have a windows machine available, I am not able to work on this. De-assigning me and removing from next milestone.

@ralsina ralsina removed their assignment Aug 20, 2016
@ralsina ralsina modified the milestones: Whenever, v7.7.13 Aug 20, 2016
@Kwpolska Kwpolska modified the milestones: v7.7.13, Whenever Aug 26, 2016
@Kwpolska Kwpolska self-assigned this Aug 26, 2016
Kwpolska added a commit that referenced this issue Aug 26, 2016
Turns out the `calendar` module still breaks with set/get/set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants