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

DATE_FORMATS on Xubuntu/Ubuntu pelicanconf.py #4

Closed
gotchafr opened this issue Nov 4, 2017 · 1 comment
Closed

DATE_FORMATS on Xubuntu/Ubuntu pelicanconf.py #4

gotchafr opened this issue Nov 4, 2017 · 1 comment

Comments

@gotchafr
Copy link
Contributor

gotchafr commented Nov 4, 2017

Hi mosra,

On Ubuntu the date format

DATE_FORMATS = {'en': ('en_US', '%b %d %Y')}

produces the error below...

I had to change to

DATE_FORMATS = {'en': ('en_US.UTF-8', '%b %d %Y')}

in order to process the site without errors. I don't know how to handle this in an elegant fashion. Testing sys.platform == 'linux'in the pelicanconf is not very nice. Perhaps just add a comment as I did on my fork:

#On Linux systems use the second format
DATE_FORMATS = {'en': ('en_US', '%b %d %Y')}
#DATE_FORMATS = {'en': ('en_US.UTF-8', '%b %d %Y')}

This is the error...

ERROR: Could not process pelican/theme.rst
  | Error: unsupported locale setting
  |___
  | Traceback (most recent call last):
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/generators.py", line 629, in generate_context
  |     context_sender=self)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/readers.py", line 572, in read_file
  |     context=context)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/contents.py", line 123, in __init__
  |     locale.setlocale(locale.LC_ALL, locale_string)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/locale.py", line 594, in setlocale
  |     return _setlocale(category, locale)
  | locale.Error: unsupported locale setting

Cheers...

@mosra
Copy link
Owner

mosra commented Nov 4, 2017

Hi, sorry, didn't see that you opened also these issues :)

This one is fixed with #5 and ba031f3, then. I think I'll need to use sys.platform at some point anyway, see mosra/magnum-website#1

@mosra mosra closed this as completed Nov 4, 2017
@mosra mosra self-assigned this Nov 4, 2017
@mosra mosra added this to TODO in Project management, marketing, website, docs via automation Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants