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

raw date crash #60

Closed
aaa34169 opened this issue Jan 23, 2017 · 5 comments · Fixed by #72
Closed

raw date crash #60

aaa34169 opened this issue Jan 23, 2017 · 5 comments · Fixed by #72

Comments

@aaa34169
Copy link

Hi

does anyone get a invalid raw date error
2017-01-23 13_28_18-output

i have no idea how to fix that

@davisp
Copy link
Collaborator

davisp commented Jan 24, 2017

Odd, can you show what you get from running this in the python prompt?

import time
print time.strftime('%z')

I'm guessing its giving you "GMT Standard Time" which should theoretically be a number like -0:00. Assuming that's what it is you'll want to either figure out how to make your time.strftime('%z') call return an appropriate timezone offset instead of a random string name.

@mikofski
Copy link

mikofski commented Apr 3, 2017

The issue is that the OP and myself are using Python-2.7 not Python-3.x in which the lower case '%z' escape is not guaranteed to return the hour offset. See this SO answer and the footnote in the Python-2 docs for time.

The solutions are:

  1. use Python-3 instead of Python-2

  2. send a PR to this repo, to change L120 to:

     currtz = datetime.now(tz.tzlocal()).strftime('%z')
    

    NOTE: you must import tz from dateutil in this module to use tz.tzlocal()

works for both versions of Python on all platforms (win32, darwin, linux2).

@osinimu
Copy link

osinimu commented Jun 3, 2018

Did this work? Having a similar issue
capture

I tried @mikofski suggestions but nothing changed

@mikofski
Copy link

mikofski commented Jun 3, 2018

But @osinimu you are still using Python-2.7, not Python-3. Can you please try Python-3? You can install Python-3.6 side-by-side with Python-2.7, use virtualenv in either Python 2 or 3 to create a Python-3 virtual environment, and then just install the packages you need for Pelican.

~/osinimu (pelican) $ virtualenv -p /c/Program\ Files/Python36/python.exe venv3
~/osinimu (pelican) $ source venv3/bin/activate
(venv3) ~/osinimu (pelican) $ pip install pelican ghp-import

cshorler added a commit to cshorler/ghp-import that referenced this issue Oct 27, 2018
@c-w c-w closed this as completed in #72 Aug 1, 2020
@c-w
Copy link
Owner

c-w commented Aug 8, 2020

This has been released in 0.6.0.

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

Successfully merging a pull request may close this issue.

5 participants