[issue18206] There is no license.html on www.python.org
New submission from py.user: [guest@localhost ~]$ python3 Python 3.3.0 (default, Sep 29 2012, 22:07:38) [GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux Type "help", "copyright", "credits" or "license" for more information.
license() See http://www.python.org/3.3/license.html
404 answer from webmaster@python.org: Hello, When I use the version of Python distributed by python.org and type "license()" I get the full license text and not the url. It seems like this might be a change made by Red Hat? Either way, the proper place to discuss issues like this is on the Python bug tracker: http://bugs.python.org/ Feel free to report an issue there and the developers can look at it. This email address is actually for reporting problems with the Python.org website! All the best, Michael Foord in Lib/site.py: [guest@localhost cpython]$ sed -n '453,456p' Lib/site.py builtins.license = _Printer( "license", "See http://www.python.org/%.3s/license.html" % sys.version, ["LICENSE.txt", "LICENSE"], [os.path.join(here, os.pardir), here, os.curdir]) [guest@localhost cpython]$ ---------- assignee: docs@python components: Documentation, Library (Lib) messages: 191095 nosy: docs@python, py.user priority: normal severity: normal status: open title: There is no license.html on www.python.org type: behavior versions: Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by STINNER Victor <victor.stinner@gmail.com>: ---------- nosy: +georg.brandl _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Georg Brandl added the comment: This broke because we now have release 3.3.0 instead of 3.3. But it's easy to add a redirect, which I've done now. In the future, site.py should be fixed to say 3.3.0 or 3.3.X depending on the current bugfix version. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
R. David Murray added the comment: For anyone who wants to work on this: the license URL is printed if only if the license file can't be found. ---------- keywords: +easy nosy: +r.david.murray stage: -> needs patch title: There is no license.html on www.python.org -> license url in site.py should always use X.Y.Z form of version number versions: +Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +patch nosy: +berker.peksag stage: needs patch -> patch review Added file: http://bugs.python.org/file30621/issue18206.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
R. David Murray added the comment: It would be nice to add a test (guarded by the network resource) that checks that the generated url in license is not a 404. Would you be interested in tackling that, Berker? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by Demian Brecht <demianbrecht@gmail.com>: ---------- nosy: +dbrecht _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by py.user <bugzilla-mail-box@yandex.ru>: Added file: http://bugs.python.org/file30755/issue18206_test.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Roundup Robot added the comment: New changeset a723adeb1f47 by Senthil Kumaran in branch '3.3': Fix License URL display and add test to check for license url presence. http://hg.python.org/cpython/rev/a723adeb1f47 New changeset 12aaf64feca2 by Senthil Kumaran in branch 'default': merge from 3.3 http://hg.python.org/cpython/rev/12aaf64feca2 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Senthil Kumaran added the comment: Fixed in the 3.3 and 3.4. 3.3 - changeset a723adeb1f47 3.4 - changeset 12aaf64feca2 3.4 - (Fixed a merge conflict) changeset 6ecdf2b3192b ---------- nosy: +orsenthil resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
py.user added the comment: Senthil Kumaran changed the pattern from: r'^See (http://www\.python\.org/[^/]+/license.html)$' to: r'^See (http://www\.python\.org/download/releases/[^/]+/license/)$' test doesn't pass [guest@localhost cpython]$ ./python Python 3.4.0a2+ (default, Sep 14 2013, 05:56:46) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux Type "help", "copyright", "credits" or "license" for more information.
license() See http://www.python.org/3.4/license.html
make test ... [265/380/3] test_site test test_site failed -- Traceback (most recent call last): File "/home/guest/tmp/tests/misc/git/example/cpython/Lib/test/test_site.py", line 416, in test_license_page self.assertIsNotNone(mo, msg='can\'t find appropriate url in license') AssertionError: unexpectedly None : can't find appropriate url in license ... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by py.user <bugzilla-mail-box@yandex.ru>: ---------- status: closed -> pending _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
R. David Murray added the comment: The test needs to be fixed so that it runs even when the LICENSE file exists. (It is also missing the skip when the network resource is not asserted.) I have a patched test, and a fix for the 3.4 problem, but I can't apply it because the 3.4.0 license file does not yet exist on the website. On the other hand, this test could be a pain before the first alpha is released (the web URL doesn't exist yet), so perhaps the test also needs to special case that somehow. ---------- nosy: +larry status: pending -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
py.user added the comment: R. David Murray wrote:
It is also missing the skip when the network resource is not asserted.
How it connects, I copied from another python tests. The test was skipped without network connection. "support.requires('network')" ?
the 3.4.0 license file does not yet exist on the website
http://www.python.org/download/releases/3.4.0/license/ opens
The test needs to be fixed so that it runs even when the LICENSE file exists.
The fixture can rename it back and forth. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Changes by py.user <bugzilla-mail-box@yandex.ru>: ---------- title: license url in site.py should always use X.Y.Z form of version number -> The license url in site.py should always use X.Y.Z form of version number _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
py.user added the comment: The patch needs to be compatible with version 2.7 Now there urllib.request is importing only. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Roundup Robot added the comment: New changeset 7c18b799841e by R David Murray in branch '3.3': #18206: Fix test for existence of license URL. http://hg.python.org/cpython/rev/7c18b799841e New changeset 321c3c9cd1b5 by R David Murray in branch 'default': Merge #18206: Fix test for existence of license URL. http://hg.python.org/cpython/rev/321c3c9cd1b5 New changeset 9354325d2ee4 by R David Murray in branch 'default': #18206: Re-fix license URL. http://hg.python.org/cpython/rev/9354325d2ee4 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
R. David Murray added the comment: You are right, there was a further typo in the 3.4 URL that I missed. Yes, requires_resource('network') is what I was referring to (though using transient_internet is also a very good idea :). I also changed the urllib call to only do a HEAD request. No need to rename the LICENSE file, I just pulled the info out of the data structure. It's a white box test, but then so is parsing the "See" line at all, so I think it is acceptable. (I wonder if it would be worthwhile to have transient_internet call requires_resource('network')?) ---------- status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
Senthil Kumaran added the comment: Thanks for making these changes (and correcting some of my mistakes), RDM. They are much better now. On Sat, Sep 14, 2013 at 10:38 AM, R. David Murray <report@bugs.python.org>wrote:
R. David Murray added the comment:
You are right, there was a further typo in the 3.4 URL that I missed.
Yes, requires_resource('network') is what I was referring to (though using transient_internet is also a very good idea :). I also changed the urllib call to only do a HEAD request. No need to rename the LICENSE file, I just pulled the info out of the data structure. It's a white box test, but then so is parsing the "See" line at all, so I think it is acceptable.
(I wonder if it would be worthwhile to have transient_internet call requires_resource('network')?)
---------- status: open -> closed
_______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18206> _______________________________________
participants (8)
-
Berker Peksag
-
Demian Brecht
-
Georg Brandl
-
py.user
-
R. David Murray
-
Roundup Robot
-
Senthil Kumaran
-
STINNER Victor