Skip to content

Conversation

ismaell
Copy link
Contributor

@ismaell ismaell commented May 30, 2021

Make Lektor compatible with Werkzeug 2.x.

Issue(s) Resolved

Related Issues / Links

Description of Changes

  • Replaces werkzeug.posixemulation.rename with os.replace
  • Changes dep to Werkzeug<3

from werkzeug.posixemulation import rename
try:
from os import replace as rename
except ImportError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that Lektor no longer supported python < 3.6, os.replace should always be available. (I think?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't realize that, then I'll remove the fallback.

@ismaell ismaell force-pushed the master branch 2 times, most recently from 2dfde73 to 3203872 Compare May 30, 2021 20:55
ismaell added 2 commits June 27, 2021 23:39
This function has been always internal, and has been removed from
Werkzeug 2.x.

Since 3.3, Python provides os.replace, a cross-platform atomic rename
function.

Ref: pallets/werkzeug#1759
Ref: https://bugs.python.org/issue8828
@SrijanSriv
Copy link

Hi! I believe this will install Werkzeug 2.x instead of 0.16. Is there a way to do it on my system manually? I'm running Ubuntu 20.04 by the way.
It gets installed through curl -sf https://www.getlektor.com/installer.py | python3 and immediately gives the error of how Werkzeug is not updated enough for Flask(I'm sorry I don't remember its version) and I can't do anything with lektor from there.
Thanks!

@ismaell
Copy link
Contributor Author

ismaell commented Jul 21, 2021

@SrijanSriv you would need to download the source code, apply the patch from this PR, then install from there...

@SrijanSriv
Copy link

SrijanSriv commented Jul 21, 2021

Thanks a ton! I have had issues about this for a while now. One more thing, the lektor from this development version runs only through venv right? I have the faulty lektor installed from the above mentioned link(which I can't delete for some reason?) and I don't want it to interfere with a sudden error.
Is there a way to delete the faulty lektor?

@ismaell
Copy link
Contributor Author

ismaell commented Jul 21, 2021

lektor from this development version runs only through venv right?

You can also install it "normally" using setup.py...

I have the faulty lektor installed from the above mentioned link(which I can't delete for some reason?) and I don't want it to interfere with a sudden error.
Is there a way to delete the faulty lektor?

I think it uses pip, so:

pip uninstall lektor

@andoresuperesu
Copy link

andoresuperesu commented Jul 29, 2021

Copy link
Member

@yagebu yagebu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! :)

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 this pull request may close these issues.

Port to Werkzeug 2.x

5 participants