WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 31533
webkitpy __init__.py (webkit-patch) should detect python < 2.5 and show a nice error message
https://bugs.webkit.org/show_bug.cgi?id=31533
Summary
webkitpy __init__.py (webkit-patch) should detect python < 2.5 and show a nic...
Eric Seidel (no email)
Reported
2009-11-16 01:31:34 PST
bugzilla-tool should detect python < 2.5 and show a nice error message Google has this screwy config where "python" maps to python 2.4 instead of python 2.5 on the corp image. Presumably this will go away when we migrate to snow leopard, but for now everyone who tries bugzilla-tool on a google mac gets an ugly parse error. We could fix this via: 1. Using a different #! line, like: "#!/usr/bin/env python2.5" 2. Detecting python < 2.5 (or missing ternary operators) and show a nice error message, including even something about how to fix your Google mac. :) 3. Some other nifty hack.
Attachments
Proposed patch
(11.20 KB, patch)
2010-03-07 17:07 PST
,
Chris Jerdonek
abarth
: review+
cjerdonek
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Tony Chang
Comment 1
2009-11-16 10:04:26 PST
Would it be hard to just support python2.4? I don't really like python's ternary syntax anyway. If you want to detect version, you can use sys.version_info.
Mark Rowe (bdash)
Comment 2
2009-11-16 11:37:07 PST
Solution 1 isn’t a good idea since it’ll break for folks that only have Python > 2.5.
Eric Seidel (no email)
Comment 3
2009-11-16 14:44:48 PST
I'm not sure how difficult it would be support 2.4. I'd have to check what other features we depend on.
Chris Jerdonek
Comment 4
2010-01-26 20:45:22 PST
For future reference, here is a case of code breaking with Python 2.5:
https://bugs.webkit.org/show_bug.cgi?id=33365#c9
Maybe test-webkitpy should issue a warning if run using Python 2.6+.
Chris Jerdonek
Comment 5
2010-03-07 17:07:35 PST
Created
attachment 50180
[details]
Proposed patch I didn't add any information about how to upgrade. Perhaps we can simply include a link to this wiki page, and include instructions there:
http://trac.webkit.org/wiki/PythonGuidelines
Let me know your preference. Also, note that pending patches in the following two reports are required for this patch to work:
https://bugs.webkit.org/show_bug.cgi?id=35828
https://bugs.webkit.org/show_bug.cgi?id=35788
So the style bot may not work. Also marking cq- for that reason.
Adam Barth
Comment 6
2010-03-13 02:23:11 PST
Comment on
attachment 50180
[details]
Proposed patch I'm not wild about the name "patcher.py". We've discussed the issue of python version requirements a bunch. I'm not 100% sure what the final resolution was, but this patch is just making the code print a nicer error message. If we want to support older versions of Python, we can still do that.
Chris Jerdonek
Comment 7
2010-03-13 16:05:14 PST
(In reply to
comment #6
)
> (From update of
attachment 50180
[details]
) > I'm not wild about the name "patcher.py".
Agreed. We can rename in a later patch. I mainly wanted to choose something without "webkit" in the name since it's redundant with being in webkitpy. Naming the main lead-in file for a package main.py might be a good way to go. But that didn't quite seem to fit here since the module does more than expose a main method -- it defines a substantive class.
> We've discussed the issue of python version requirements a bunch. I'm not 100% > sure what the final resolution was, but this patch is just making the code > print a nicer error message. If we want to support older versions of Python, > we can still do that.
Exactly. Hopefully we'll get clarification on that soon. I might prod the list again on Monday -- this time with an attempted summary.
Chris Jerdonek
Comment 8
2010-03-13 16:24:35 PST
Manually committed (via git svn dcommit):
http://trac.webkit.org/changeset/55972
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug