Closed Bug 537571 Opened 14 years ago Closed 14 years ago

client.py should error out early if wrong python version

Categories

(MailNews Core :: Build Config, defect)

defect
Not set
minor

Tracking

(thunderbird3.0 .4-fixed)

RESOLVED FIXED
Thunderbird 3.1a1
Tracking Status
thunderbird3.0 --- .4-fixed

People

(Reporter: Callek, Assigned: Callek)

Details

(Keywords: fixed-seamonkey2.0.4, Whiteboard: [Bv1 is fixed-thunderbird3.1b1])

Attachments

(2 files, 1 obsolete file)

Our client.py requires at least py 2.4 (for subprocess use) and does not [yet] work with python 3.0+

We should abort early with a meaningful error message about this.
Attached patch v1 -- check version (obsolete) — Splinter Review
this should probably get added to 1.9.1 branch too...
Attachment #419803 - Flags: review?(kairo)
Comment on attachment 419803 [details] [diff] [review]
v1 -- check version

Actually, I'm gonna forward this to gozer due my bad knowledge of Python, but I'm OK with the general idea of what this is doing.
Attachment #419803 - Flags: review?(kairo) → review?(gozer)
Status: UNCONFIRMED → NEW
Ever confirmed: true
As well error out for version < 2 too...
Status: NEW → ASSIGNED
Flags: in-testsuite-
Comment on attachment 419803 [details] [diff] [review]
v1 -- check version

sys.version_info returns |(2, 5, 4, 'final', 0)|, for example.

>+if pyver[0] == 2 and pyver[2] < 4:

s/pyver[2]/pyver[1]/ !
Attachment #419803 - Attachment is obsolete: true
Attachment #419803 - Flags: review?(gozer)
Attachment #421483 - Flags: review?(gozer)
Attachment #421483 - Flags: review?(gozer) → review+
Comment on attachment 421483 [details] [diff] [review]
v2, without typo
[Checkin: Comment 6]

changeset:   4695:2236baab4456
tag:         tip
user:        Justin Wood <Callek@gmail.com>
date:        Wed Jan 13 15:53:10 2010 -0500
files:       client.py
description:
Bug 537571,  client.py should error out early if wrong python version
r+=gozer


pushing to ssh://hg.mozilla.org/comm-central/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.1a1
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

I'm inclined not to take this... I haven't heard of anyone still using py 1.x, and by the time py 4.x is out I suspect we'll have some updates here anyway.

But leaving the choice up to gozer.
Attachment #422006 - Flags: review?(gozer) → review+
$ hg outgoing -v && hg push
running "ssh hg.mozilla.org "hg -R comm-central/ serve --stdio""
comparing with ssh://hg.mozilla.org/comm-central/
searching for changes
changeset:   4715:a7bc632efcd7
user:        Florian Quèze <florian@queze.net>
date:        Tue Jan 19 22:10:55 2010 -0500
files:       Makefile.in
description:
Bug 446690, make distclean does not fully clean a hg src build
r+=KaiRo, [slight] bitrot fixed by Callek


changeset:   4716:ed37438a476a
tag:         tip
user:        Serge Gautherie <sgautherie.bz@free.fr>
date:        Sat Jan 16 07:54:00 2010 -0500
files:       client.py
description:
Bug 537571 - client.py should error out early if wrong python version;
(Bv1) Detect v1- and (future) v4+ too. r+=Gozer


pushing to ssh://hg.mozilla.org/comm-central/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 2 changes to 2 files

http://hg.mozilla.org/comm-central/pushloghtml?fromchange=9defd59740d1&tochange=ed37438a476a
Attachment #421483 - Attachment description: v2, without typo → v2, without typo [Checkin: Comment 6]
Attachment #422006 - Attachment description: (Bv1) Detect v1- and (future) v4+ too → (Bv1) Detect v1- and (future) v4+ too [Checkin: Comment 9]
Whiteboard: [Bv1 is fixed-thunderbird3.1b1]
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

requesting approval as this cuts down on failure cases for those who would try and build on 1.9.1 branch... 

This request applies to both patches on this bug.

(Would like both SeaMonkey drivers and TB drivers to agree before pushing)
Attachment #422006 - Flags: approval-thunderbird3.0.2?
Attachment #422006 - Flags: approval-seamonkey2.0.3?
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

On shared code, wo usually go with the Thunderbird approval alone, esp. as it's often Standard8 who who the actual approval and he's able to speak for both projects there.
I can accept this from my POV, therefore marking the SeaMonkey side, but I'll leave the actual decision to Mark or someone else of TB drivers.
Attachment #422006 - Flags: approval-seamonkey2.0.3? → approval-seamonkey2.0.3+
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

Presumably both these patches are required. So a=Standard8 for both of them.
Attachment #422006 - Flags: approval-thunderbird3.0.2? → approval-thunderbird3.0.2+
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

We're about to cut SM 2.0.3 builds and this is not really needed for them, but hasn't landed. Please hold off landing until the relbranch is cut and SM branch version bumped to 2.0.4pre.
Attachment #422006 - Flags: approval-seamonkey2.0.4+
Attachment #422006 - Flags: approval-seamonkey2.0.3-
Attachment #422006 - Flags: approval-seamonkey2.0.3+
Callek, could you land this on c-1.9.1?
(In reply to comment #14)
> Callek, could you land this on c-1.9.1?

I don't have a 191 tree atm; checkin-needed
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

Obviously this didn't land for 3.0.2, please try and get it in 3.0.4.
Attachment #422006 - Flags: approval-thunderbird3.0.2+ → approval-thunderbird3.0.4+
Comment on attachment 422006 [details] [diff] [review]
(Bv1) Detect v1- and (future) v4+ too
[Checkin: Comment 9]

Pushed both patches as http://hg.mozilla.org/releases/comm-1.9.1/rev/0c2b5eba28e7

Had to account for some (minor) divergence between branch and head.
Indentation of that change was incorrect, Thunderbird3.0 tree is burning as a result.

  File "client.py", line 33
    if pyver[0] <= 1 or (pyver[0] == 2 and pyver[1] < 4):
     ^
IndentationError: expected an indented block
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
changeset:   4766:34ce0fb973f9
tag:         tip
user:        Philippe M. Chiasson <gozer@mozillamessaging.com>
date:        Fri Mar 12 16:35:40 2010 -0500
summary:     Bug 537571. client.py bustage fix from 0c2b5eba28e7. rs=Standard8

diff --git a/client.py b/client.py
--- a/client.py
+++ b/client.py
@@ -29,10 +29,8 @@
 import sys
 # Test Python Version. 2.4 required for `import subprocess`
 pyver = sys.version_info
-if pyver[0] == 2 and pyver[1] < 4:
 if pyver[0] <= 1 or (pyver[0] == 2 and pyver[1] < 4):
   sys.exit("ERROR: Python 2.4 or newer required")
-elif pyver[0] == 3:
 elif pyver[0] >= 3:
   sys.exit("ERROR: Python series 3 is not supported, use series 2 > 2.4")
 del pyver
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Verifying fixed 3.0 on the basis that the patch landed and the subsequent bustage fix haven't broken the builds, and no complaints about Python versions.
You need to log in before you can comment on or make changes to this bug.