Closed
Bug 601649
Opened 14 years ago
Closed 14 years ago
Client.py doesn't work with python3
Categories
(MailNews Core :: Build Config, defect)
MailNews Core
Build Config
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.3a1
People
(Reporter: fredbezies, Assigned: Callek)
Details
Attachments
(1 file)
627 bytes,
patch
|
standard8
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b7pre) Gecko/20100101 Firefox/4.0b7pre Build Identifier: Archlinux upgraded today its python version to python3 in its testing repository, and created a python2 package with python 2.7 in it. [fred@fredo-arch src]$ python2 Python 2.7 (r27:82500, Aug 17 2010, 12:18:26) [GCC 4.5.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. [fred@fredo-arch src]$ python Python 3.1.2 (r312:79147, Oct 4 2010, 12:45:09) [GCC 4.5.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. When I wanted to update my shredder source code, I got this : [fred@fredo-arch src]$ python client.py checkout --verbose File "client.py", line 100 print "Executing command:", cmd ^ SyntaxError: invalid syntax Reproducible: Always Steps to Reproduce: 1.Update to Python 3 2.run python client.py checkout --verbose Actual Results: Crash. Expected Results: client.py grabbing updates.
Updated•14 years ago
|
Component: General → Build Config
Product: Core → Thunderbird
QA Contact: general → build-config
Assignee | ||
Comment 1•14 years ago
|
||
Which comm-central branch are you trying to pull? Trunk should already catch that. http://mxr.mozilla.org/comm-central/source/client.py?mark=61-68#61
Severity: normal → minor
OS: Linux → All
Product: Thunderbird → MailNews Core
QA Contact: build-config → build-config
Hardware: x86_64 → All
Reporter | ||
Comment 2•14 years ago
|
||
Well, it doesn't work with python 3.1.2 And my computer is trying to pull trunk code. As there is a /usr/bin/python2 symlink for /usr/bin/python2.7, I can workaround this problem by doing : python2 client.py checkout --verbose instead of python client.py checkout
Reporter | ||
Comment 3•14 years ago
|
||
By the way, I tried to reproduce by hand the sniffing version line.
Here is what I get :
[fred@fredo-arch ~]$ python
Python 3.1.2 (r312:79147, Oct 4 2010, 12:45:09)
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> pyver = sys.version_info
>>> pyver[0]
3
So there is a problem somewhere ;)
Assignee | ||
Comment 4•14 years ago
|
||
Ok, lets see: #1 can you try |sys.exit("test")| in your py3 shell and tell me if that errors on you? #2 can you try running |http://callek.pastebin.mozilla.org/806504| and see if THAT errors on you? #3 can you try running |http://callek.pastebin.mozilla.org/806505| I'd be interested to see which fails for you. Also can you do an |hg identify| in your repo where client.py is located, I'd also like to know what revision you are running.
Assignee | ||
Updated•14 years ago
|
Status: NEW → UNCONFIRMED
Ever confirmed: false
Reporter | ||
Comment 5•14 years ago
|
||
1) Python 3.1.2 (r312:79147, Oct 4 2010, 12:45:09)
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> sys.exit("test")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined
2) ERROR: Python series 3 is not supported, use series 2 >= 2.4
3) [fred@fredo-arch download]$ python 806505.txt
File "806505.txt", line 70
print "Purposely fail py3 semantics"
^
SyntaxError: invalid syntax
4) [fred@fredo-arch src]$ hg identify
086d167a0505 tip
Assignee | ||
Comment 6•14 years ago
|
||
(In reply to comment #5) > 2) ERROR: Python series 3 is not supported, use series 2 >= 2.4 > > 3) [fred@fredo-arch download]$ python 806505.txt > File "806505.txt", line 70 > print "Purposely fail py3 semantics" > ^ > SyntaxError: invalid syntax > Argh, py3.1 is parsing "ahead" of where it needs to execute and bailing. :/ I might have an idea, but need to investigate. And since I don't really want to install py3.1 on my system I'll rely on you to test my theory. Will do it within the week though.
Assignee: nobody → bugspam.Callek
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Reporter | ||
Comment 7•14 years ago
|
||
No problem. If I can help you, I'll do it with pleasure.
Assignee | ||
Comment 8•14 years ago
|
||
Ok, after investigating this, it turns out that the full context needs to be valid py<ver> for it to begin executing. Which means that the whole file needs py3 syntax to parse the pyver test, and thus bail out. I have an idea to make the error more prevalent (use |print "..."| instead of |sys.exit| with a proper comment) But otherwise, I don't see an easy way to avoid the traceback, unless I was to split out the entirety of client.py to a new file, except for the ver check; which I don't want to do.
Assignee | ||
Comment 9•14 years ago
|
||
Attachment #481395 -
Flags: review?(bugzilla)
Comment 10•14 years ago
|
||
Comment on attachment 481395 [details] [diff] [review] Make py3 error (more) clearly. Yep, let's give this a try.
Attachment #481395 -
Flags: review?(bugzilla) → review+
Assignee | ||
Comment 11•14 years ago
|
||
Pushed as: http://hg.mozilla.org/comm-central/rev/426abd4c74c7 Frederic, is this satisfactory at least until we (start) supporting py3 ?
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Flags: in-testsuite-
Target Milestone: --- → Thunderbird 3.3a1
Version: unspecified → Trunk
Reporter | ||
Comment 12•14 years ago
|
||
I think so. I will not have time to test this at least until tuesday morning.
You need to log in
before you can comment on or make changes to this bug.
Description
•