msg52484 - (view) |
Author: Tim Couper (drtimcouper) |
Date: 2007-04-20 16:50 |
Extension of test code for jython |
|
|
msg59774 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2008-01-12 01:47 |
The patch would need to be checked against Jython's last release and/or the current trunk. |
|
|
msg87791 - (view) |
Author: Daniel Diniz (ajaksu2) *  |
Date: 2009-05-15 02:12 |
Can someone ping the Jython tracker for help on this? |
|
|
msg88695 - (view) |
Author: Greg Ward (gward)  |
Date: 2009-06-02 00:17 |
I just took a look at the original patch uploaded by drtimcouper. IMHO it would be cleaner and simpler to modify optparse.py so that it behaves as consistently as possible under Jython and CPython. For example, optparse should catch the ValueError raised when a user supplies a bad integer input and raise a new exception with a consistent error message. That sort of thing. drtimcouper: if you're still out there and reading this, would you mind submitting a new patch? |
|
|
msg88698 - (view) |
Author: Philip Jenvey (pjenvey) *  |
Date: 2009-06-02 00:45 |
This looks like it was against Jython 2.2? Jython 2.5 passes 2.5's test_optparse with only fixing __builtins__ and disabling the weakref test So uses of __builtins__ should should be importing __builtin__ and use that instead. sys.platform.startswith('java') should be test_support.is_jython instead. And on 2.6/3.2 you can now decorate test_refleak with @test_support.impl_check('Relies on sys.getrefcount', cpython=True) to skip it |
|
|
msg116664 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2010-09-17 13:49 |
How do we find out which versions of optparse and test_optparse jython is currently using? |
|
|
msg128325 - (view) |
Author: Sandro Tosi (sandro.tosi) *  |
Date: 2011-02-10 18:20 |
Hi, since optparse is now deprecated (in favor of argparse) and in a year and half there was not progress on this, I'm closing this report. |
|
|
msg128410 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2011-02-11 17:44 |
Hi Sandro. I think you may have closed too fast here: optparse is deprecated in docs only, it’s not the recommendation anymore, but IIUC bugs should still be fixed. A year and a half is sadly not a very long time for a Python bug, time is usually not a criterion for closing. David, please correct any inaccuracy in my message :) |
|
|
msg128415 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2011-02-11 18:28 |
Making the tests pass on Jython is certainly worthwhile, if anyone wants to do it. At a quick glance it looks like the optparse tests just need to be updated and made a bit more lenient. Since Jython is lagging CPython by so much a fix isn't going to help them for a quite a while even if it gets done now. Really, this is a candidate bug to be moved to the library tracker if/when the CPython/library split happens. So I suppose we should leave it open in anticipation of that move happening some day :) |
|
|
msg216182 - (view) |
Author: Christian Hudon (chrish42) * |
Date: 2014-04-14 19:13 |
Which version of Jython should I concentrate on to make these tests pass? The 2.5.4 release candidate, or the 2.7 beta? |
|
|
msg216202 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2014-04-14 20:26 |
I'm guessing they've got a local fix in the release candidate and won't change even their test code there, so I'd guess the beta. But the jython folks would really be the ones to ask. Perhaps they will respond here (they are not at pycon). |
|
|
msg216220 - (view) |
Author: Christian Hudon (chrish42) * |
Date: 2014-04-14 21:11 |
I'll use Jython 2.7. The Jython people can backport the fix to 2.5.4, if they want it there too. So... this is marked as related to Python 3.2, but Jython is on Python 2 of course. I'll just take the version as being wrong. So, what should the patch that fixes this be based on? Not Python 3, obviously. But CPython 2.7's latest? Or the Jython 2.7 repository? And where should the fix be committed? In CPython's repository, or in Jython? |
|
|
msg216259 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2014-04-15 01:08 |
Well, we want it to apply to python3 as well, since we want to see jython support python3 eventually :) Also, optparse is present in python3 for backward compatibility reasons only...there were very few changes between the time python3 branched from python2 and argparse superceeded optparse. So the differences between the two code bases should be minimal. Obviously you can't test against jython3, since it doesn't exist, but what you can do is make the patch based on the python2 optparse, and then see if the patch applies cleanly to python3. It probably won't, but as far as I can see from a quick diff, most of the changes will be related to the changes between python2 syntax and python3 syntax, and will be easy to forward port even without being able to test it directly against jython. |
|
|
msg216300 - (view) |
Author: Christian Hudon (chrish42) * |
Date: 2014-04-15 14:50 |
Actually, the only optparse test failing on jython 2.7 beta 1 currently is the one that relies on sys.getrefcount. Adding a test_support.impl_detail() guard makes all the tests pass. (See attached patch.) I'd propose adding this patch to both the python3 and python2 tips, as it would make the life of other, non-cpython implementations easier, and then closing this bug. |
|
|
msg216310 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2014-04-15 15:36 |
Patch to add impl_detail() looks fine to me. |
|
|
msg216383 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-04-15 20:44 |
New changeset a1ef419c0cfb by Andrew Kuchling in branch '2.7': #1704474: mark refleak test as specific to CPython http://hg.python.org/cpython/rev/a1ef419c0cfb |
|
|
msg216414 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-04-16 01:16 |
New changeset c76d782cb9df by Andrew Kuchling in branch '3.4': #1704474: mark refleak test as specific to CPython http://hg.python.org/cpython/rev/c76d782cb9df |
|
|
msg216417 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2014-04-16 01:33 |
Committed to 2.7, 3.4, and default. Thanks for your patch! |
|
|