-
-
Notifications
You must be signed in to change notification settings - Fork 60
Redirect all 2.7 files removed in Python 3 #201
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
Conversation
@JulienPalard I didn't see any instructions on how to test this, so let me know if it works. |
it doesn't make sense to redirect 3.42
Syntacticly this looks right :) I'm going to have to defer to @JulienPalard for if the actual URLs and Locations are correct before merging. |
return 301 https://$host/$1$2/; | ||
} | ||
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/howto/(doanddont|webservers).html$ { | ||
return 301 https://$host/$1$2/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 301 https://$host/$1$2/; | |
return 301 https://$host/$1$2/howto/; |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I clicked on https://docs.python.org/3/howto/webservers.html I (probably) don't care about other how-to's, I care to know that the link no longer works and I think linking to the homepage of the docs is better for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right.
Looks really nice, I this this is the little things I appreciate when reading a doc. How did you managed to craft the list in the first place? All by hand? I think we can expect Python 3.11 and a few future versions:
|
You can get the list of files missing by downloading a copy of the documentation and using cd /tmp
wget https://docs.python.org/2/archives/python-2.7.18-docs-html.zip
unzip python-2.7.18-docs-html.zip
wget https://docs.python.org/3/archives/python-3.9.1-docs-html.zip # new link at https://docs.python.org/3/download.html
unzip python-3.9.1-docs-html.zip
comm -23 <(find python-2.7.18-docs-html/ | cut -d'/' -f2- | sort) <(find python-3.9.1-docs-html/ | cut -d'/' -f2- | sort) But I actually got the list with a Python script that reads the documentation and finds all the
I did it that way first too, but then I thought it would be weird to see a link to the docs with "/3.99/" as the version number and have that link actually work when the latest version is 3.10. I think it makes more sense to hard code the currently supported versions. You could update it with a |
Co-authored-by: Julien Palard <[email protected]>
LGTM. @ewdurbin. |
OK, these redirects are now live, but will take some time to propagate through the CDN cache. |
There's a redirect loop on this page: https://docs.python.org/3/library/dbm.html see #204 |
See python/cpython#24195 and python/pythondotorg#1719
Also see https://github.com/verhovsky/py3redirect/blob/master/special-cases.js for a list of anchors that have been moved.
Generated using the following code: