Issue332

Title do not run translator with python2.6
Priority feature Status resolved
Superseder Nosy List jendrik, malte
Assigned To jendrik Keywords
Optional summary

Created on 2012-05-01.12:07:09 by jendrik, last changed by jendrik.

Messages
msg2156 (view) Author: jendrik Date: 2012-05-01.19:54:16
Oops, yes, I don't think I can change that habbit ;)

Merged. Mail sent to google group.
msg2155 (view) Author: malte Date: 2012-05-01.19:19:08
Looks good! One last minor niggle before you merge: we use "double-quoted"
strings everywhere in the translator. It'd be good not to start mixing styles.
msg2154 (view) Author: jendrik Date: 2012-05-01.19:10:02
I uploaded a new patch set.
msg2153 (view) Author: malte Date: 2012-05-01.15:42:26
Sure, that'll make the code cleaner, too. We actually had bugs in the past where
a typo in a local variable name was missed because a global variable of the same
name was introduced in the __main__ block.

(Regarding Python 2.6, I missed the from __future__ import at the top in my
small test.)
msg2152 (view) Author: jendrik Date: 2012-05-01.15:40:02
It runs fine here. However testing with the test script would be easier 
if the code under __name__ == '__main__' would be encapsulated in a 
function (e.g. main()). Can I add that?
msg2151 (view) Author: malte Date: 2012-05-01.15:20:36
Thanks!

Have you run the test script? I don't think this code will run on Python 2.6.
msg2150 (view) Author: jendrik Date: 2012-05-01.14:00:03
I incorporated your comments and uploaded a new patch set.
msg2149 (view) Author: malte Date: 2012-05-01.13:13:30
Can we use optparse instead? There's other options I'd like to add eventually;
at least the stuff that is currently set via constants in translate.py.

Also, I'd prefer to see this functionality moved to a function, and to also have
a warning message printed when the force flag is set. Finally, warning and error
messages should be printed to stderr, not stdout. (We're not consistent in that
in the translator, but we've been enforcing this for a while in the search code.)
msg2148 (view) Author: jendrik Date: 2012-05-01.12:41:13
Rietveld issue created: http://codereview.appspot.com/6133062/
msg2146 (view) Author: jendrik Date: 2012-05-01.12:07:08
From issue329:

Malte: I think we really need a big fat warning when Python 2.6 is used. Actually, I
think the planner should even refuse to run unless it is passed a special option
("--force" or whatever). ("Errors should never pass silently, unless explicitly
silenced", and major performance degradation definitely is an error in our field.)
History
Date User Action Args
2012-05-01 19:54:16jendriksetstatus: chatting -> resolved
messages: + msg2156
2012-05-01 19:19:08maltesetmessages: + msg2155
2012-05-01 19:10:03jendriksetmessages: + msg2154
2012-05-01 15:42:26maltesetmessages: + msg2153
2012-05-01 15:40:02jendriksetmessages: + msg2152
2012-05-01 15:20:37maltesetmessages: + msg2151
2012-05-01 14:00:03jendriksetmessages: + msg2150
2012-05-01 13:13:31maltesetmessages: + msg2149
2012-05-01 12:41:13jendriksetstatus: unread -> chatting
messages: + msg2148
2012-05-01 12:08:43jendriklinkissue329 superseder
2012-05-01 12:07:09jendrikcreate