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

Python 3k #264

Closed
AndreaCrotti opened this Issue Mar 17, 2012 · 15 comments

Comments

Projects
None yet
7 participants
@AndreaCrotti
Copy link
Contributor

AndreaCrotti commented Mar 17, 2012

I think it would be nice to at least start to think about supporting Python3.

Is any of the used libraries only working for Python 2k?

@almet

This comment has been minimized.

Copy link
Member

almet commented Apr 1, 2012

Agreed. @kylef had a look and says that the only blocker (in the deps) is the feedgenerator, should not be to hard to fix.

@samueljohn

This comment has been minimized.

Copy link

samueljohn commented Jun 28, 2012

Still no python3?

@almet

This comment has been minimized.

Copy link
Member

almet commented Jun 28, 2012

Do you want to work on that? :) @kylef started but that's not ready if
I'm not mistaken.

@samueljohn

This comment has been minimized.

Copy link

samueljohn commented Jun 28, 2012

I am just getting started with pelican. The first encounter was that

    except Exception, e:
                    ^
SyntaxError: invalid syntax

Then I realized it may not be py3k ready :(

@kylef is there a show-stopper?

@dmdm

This comment has been minimized.

Copy link
Contributor

dmdm commented Aug 24, 2012

DUNNIT -- well, almost ;)

2 tests are failing. Please help me on them, have no picture of what generators are supposed to do.

Fork is here, look for branch "py3k": https://github.com/dmdm/pelican/tree/py3k

You also will need my port of feedgenerator: https://github.com/dmdm/feedgenerator-py3k
(Original homepage seems to be down... ?)

Maybe you are interested in my port of yolk, too (branch Py3k): https://github.com/dmdm/yolk/tree/Py3k

The results of Pelican's unit tests I have stored here: https://github.com/dmdm/pelican/blob/py3k/unittest-log-20120824_0217.txt

For info about which libs are installed in the development virtualenv, please look here: https://github.com/dmdm/pelican/blob/py3k/dev_requirements-fulfilled.txt

@honzajavorek

This comment has been minimized.

Copy link
Contributor

honzajavorek commented Aug 24, 2012

@samueljohn

This comment has been minimized.

Copy link

samueljohn commented Aug 24, 2012

👍

@dmdm

This comment has been minimized.

Copy link
Contributor

dmdm commented Aug 26, 2012

One more step towards a single codebase for Py 2 & 3: a new stand-alone feedgenerator. Yay, the Django developers managed a single code-base without 2to3 -- impressive. I extracted their current code for the stand-alone version. About the adventures I encountered: http://parenchym.com/pymblog/porting-feedgenerator-to-py3k.html

The code: https://github.com/dmdm/feedgenerator-py3k/tree/from_django_1.5.dev20120824122350

@almet

This comment has been minimized.

Copy link
Member

almet commented Aug 28, 2012

Awesome. Tell us when it's ready :-)

@dmdm

This comment has been minimized.

Copy link
Contributor

dmdm commented Aug 29, 2012

Just a short note: 2to3 is not sufficient to port the string handling correctly. At least one cause of the failing two tests mentioned above is, that Pelican produces output like b'foo' instead of foo. These cases have to be corrected manually, as 2to3 seems to not recognize them.

@dmdm

This comment has been minimized.

Copy link
Contributor

dmdm commented Aug 30, 2012

Done. Passes all tests on both Pythons. Same code-base for Python 2 and 3, no 2to3 necessary.
Branch py3k-v2: https://github.com/dmdm/pelican/tree/py3k-v2

@almet

This comment has been minimized.

Copy link
Member

almet commented Oct 25, 2012

Sorry, I didn't had the time to review it, my bad.

@dmdm what's the process to update your work with latest pelican changes? Is there anything we can do?

@justinmayer

This comment has been minimized.

Copy link
Member

justinmayer commented Feb 10, 2013

Python 3 support was added in #618. Thanks to @dmdm and the folks who helped with testing! Issued closed.

@yegle

This comment has been minimized.

Copy link
Contributor

yegle commented Feb 16, 2013

https://github.com/getpelican/pelican/blob/master/pelican/plugins/gravatar.py#L37

This line will raise an error in Py3k since hashlib.md5 only accepts bytes.

@justinmayer

This comment has been minimized.

Copy link
Member

justinmayer commented Feb 17, 2013

@yegle: Thanks for letting us know. Do you think you might be able to submit a patch to address the error with the Gravatar plugin on Python 3.x?

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