From: Tim C. <ti...@ti...> - 2007-03-20 09:59:16
|
In the interests of converging Jython to Python, I thought I'd exploring the porting of the optparse module to jython, as I couldn't find any references to optparse in jython lists. In running the python tests, I've come across the absence of jython unicode instances having a translate method (fixed I think in 2848, but for what looks like jython 2.3 ) .. which got me wondering .. has anyone done optparse already (eg for 2.3?). Also is there any reason why that unicode bugfix can't be made available in the 2.2b1 SVN release? Tim |
From: Charlie G. <cha...@gm...> - 2007-04-16 04:16:00
|
I don't think anyone has touched optparse, so go for it. As for translate, it changed between 2.2 and 2.3 to actually make sense for unicode so that exact patch won't make it. optparse only showed up in 2.3 though, so you should work on getting it to work on that branch anyway. Charlie On 3/20/07, Tim Couper <ti...@ti...> wrote: > In the interests of converging Jython to Python, I thought I'd exploring > the porting of the optparse module to jython, as I couldn't find any > references to optparse in jython lists. In running the python tests, > I've come across the absence of jython unicode instances having a > translate method (fixed I think in 2848, but for what looks like jython > 2.3 ) .. which got me wondering .. has anyone done optparse already (eg > for 2.3?). Also is there any reason why that unicode bugfix can't be > made available in the 2.2b1 SVN release? > > Tim > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Tim C. <ti...@ti...> - 2007-04-20 09:27:03
|
Charlie I think that I've got optparse.py (py2.5 version) working on jython, (passing the py2.5 tests) by using the following procedure: Copy the unchanged py 2.5 optparse.py to jython/Lib/ Copy my modified version of textwrap.py to jython/Lib/ AAdd the tests: copy the unchanged py2.5 test/test_optparse.py and test/test_textwrap.py to jython/Lib/test/ directory. I need to know where to put the jython modified version of textwrap.py for code review. Should I submit a patch relative to the py2.5 version of textwrap.py, or it that going to cause confusion? Guidance please :-) Tim _ Charlie Groves wrote: > I don't think anyone has touched optparse, so go for it. As for > translate, it changed between 2.2 and 2.3 to actually make sense for > unicode so that exact patch won't make it. optparse only showed up in > 2.3 though, so you should work on getting it to work on that branch > anyway. > > Charlie > > On 3/20/07, Tim Couper <ti...@ti...> wrote: >> In the interests of converging Jython to Python, I thought I'd exploring >> the porting of the optparse module to jython, as I couldn't find any >> references to optparse in jython lists. In running the python tests, >> I've come across the absence of jython unicode instances having a >> translate method (fixed I think in 2848, but for what looks like jython >> 2.3 ) .. which got me wondering .. has anyone done optparse already (eg >> for 2.3?). Also is there any reason why that unicode bugfix can't be >> made available in the 2.2b1 SVN release? >> >> Tim >> >> >> >> >> >> >> ------------------------------------------------------------------------- >> >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys-and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> >> _______________________________________________ >> Jython-dev mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-dev >> > > |
From: Charlie G. <cha...@gm...> - 2007-04-22 21:40:11
|
On 4/20/07, Tim Couper <ti...@ti...> wrote: > Copy the unchanged py 2.5 optparse.py to jython/Lib/ > Copy my modified version of textwrap.py to jython/Lib/ Are there big changes between the 2.5 optparse and 2.3 optparse? The way we generally include straight CPython .py files is to add them to build.Lib.include.properties in the root of a checkout, and then ant will copy them over to the built Lib directory. If there are just bugfix changes between CPython's 2.5 and 2.3 optparse I imagine we could those backported as well. As Frank indicated we'd much rather include a py file than make a slightly modified copy. > AAdd the tests: copy the unchanged py2.5 test/test_optparse.py and > test/test_textwrap.py to jython/Lib/test/ directory. The tests are already all included in build.Lib.include.properties so they should be fine once your changes are backported. Charlie |
From: A.M. K. <am...@am...> - 2007-04-20 12:56:12
|
On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: > I need to know where to put the jython modified version of textwrap.py > for code review. Should I submit a patch relative to the py2.5 version > of textwrap.py, or it that going to cause confusion? Guidance please :-) Does the 2.5 textwrap.py need a modification to work with Jython? If yes, please submit it as a patch and I'll take a look at committing it to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint branch. --amk |
From: Frank W. <fwi...@gm...> - 2007-04-20 13:28:27
|
On 4/20/07, A.M. Kuchling <am...@am...> wrote: > On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: > > I need to know where to put the jython modified version of textwrap.py > > for code review. Should I submit a patch relative to the py2.5 version > > of textwrap.py, or it that going to cause confusion? Guidance please :-) > > Does the 2.5 textwrap.py need a modification to work with Jython? If > yes, please submit it as a patch and I'll take a look at committing it > to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint > branch. Hi Tim, AMK's aproach is definitely the preferred way to modify the python files. In fact, we should probably review our modified py files in trunk to see if there are any others that could be integrated with the CPython Lib. (Probably won't be too many, since some are based on 2.3 and others are "Jython only" meaning that they rely on the java libraries. -Frank |
From: Charlie G. <cha...@gm...> - 2007-04-22 21:40:52
|
On 4/20/07, A.M. Kuchling <am...@am...> wrote: > On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: > > I need to know where to put the jython modified version of textwrap.py > > for code review. Should I submit a patch relative to the py2.5 version > > of textwrap.py, or it that going to cause confusion? Guidance please :-) > > Does the 2.5 textwrap.py need a modification to work with Jython? If > yes, please submit it as a patch and I'll take a look at committing it > to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint > branch. I think that should be 2.3-maint as that's what Jython's 2.3 branch is currently targetting. Charlie |
From: Tim C. <ti...@ti...> - 2007-04-20 16:53:49
|
I've submitted the textwrap.py patch (and a patch to test_optparse.py) against the latest python2.5 trunk svn. Please check I haven't broken anything :-) Tim A.M. Kuchling wrote: > On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: > >> I need to know where to put the jython modified version of textwrap.py >> for code review. Should I submit a patch relative to the py2.5 version >> of textwrap.py, or it that going to cause confusion? Guidance please :-) >> > > Does the 2.5 textwrap.py need a modification to work with Jython? If > yes, please submit it as a patch and I'll take a look at committing it > to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint > branch. > > --amk > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > > > |
From: Charlie G. <cha...@gm...> - 2007-04-22 22:27:53
|
The textwrap patch at http://sourceforge.net/tracker/index.php?func=detail&aid=1704474&group_id=5470&atid=305470 works around the lack of translate on unicode objects in Jython. Happily, that was fixed on the 2.3 branch and just needed to be ported back to trunk. I just backported it, so that patch doesn't need to be applied. In the test_optparse patch at http://sourceforge.net/tracker/index.php?func=detail&aid=1704474&group_id=5470&atid=305470, you can get around the lack of __builtins__ with a "import __builtin__ as __builtins__" which is probably better than ignoring the hasattr check on Java. The change to the InterceptedError section to accept unicode as well as str may have been fixed by some recent improvements to Jython's unicode support. Would you mind trying this again with the most recent code on the 2.3 branch? If it isn't fixed, we might want to see why Jython is returning unicode instead of str. I think that's probably a Jython bug. Finally, we might want to look at getting Jython's error messages for bad ints and longs to look more like CPython's rather than changing the test. It looks like there's more information in the CPython error messages so it would be nice to have them anyway. This patch will still need to go in for the __builtins__ workaround, but I think we can get rid of the other two changes. Charlie On 4/20/07, Tim Couper <ti...@ti...> wrote: > I've submitted the textwrap.py patch (and a patch to test_optparse.py) > against the latest python2.5 trunk svn. > > Please check I haven't broken anything :-) > > Tim > > A.M. Kuchling wrote: > > On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: > > > >> I need to know where to put the jython modified version of textwrap.py > >> for code review. Should I submit a patch relative to the py2.5 version > >> of textwrap.py, or it that going to cause confusion? Guidance please :-) > >> > > > > Does the 2.5 textwrap.py need a modification to work with Jython? If > > yes, please submit it as a patch and I'll take a look at committing it > > to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint > > branch. > > > > --amk > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Jython-dev mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-dev > > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Tim C. <ti...@ti...> - 2007-05-01 17:44:23
|
Charlie Sorry about the (long) delay in replying .. should be able to provide patches for optparse against the python 2.3 ok ... I'll do this sometime later this month (May) ... got a lot on just now ... :-( Tim Charlie Groves wrote: > The textwrap patch at > http://sourceforge.net/tracker/index.php?func=detail&aid=1704474&group_id=5470&atid=305470 > > works around the lack of translate on unicode objects in Jython. > Happily, that was fixed on the 2.3 branch and just needed to be ported > back to trunk. I just backported it, so that patch doesn't need to be > applied. > > In the test_optparse patch at > http://sourceforge.net/tracker/index.php?func=detail&aid=1704474&group_id=5470&atid=305470, > > you can get around the lack of __builtins__ with a "import __builtin__ > as __builtins__" which is probably better than ignoring the hasattr > check on Java. > > The change to the InterceptedError section to accept unicode as well > as str may have been fixed by some recent improvements to Jython's > unicode support. Would you mind trying this again with the most > recent code on the 2.3 branch? If it isn't fixed, we might want to > see why Jython is returning unicode instead of str. I think that's > probably a Jython bug. > > Finally, we might want to look at getting Jython's error messages for > bad ints and longs to look more like CPython's rather than changing > the test. It looks like there's more information in the CPython error > messages so it would be nice to have them anyway. > > This patch will still need to go in for the __builtins__ workaround, > but I think we can get rid of the other two changes. > > Charlie > > On 4/20/07, Tim Couper <ti...@ti...> wrote: >> I've submitted the textwrap.py patch (and a patch to test_optparse.py) >> against the latest python2.5 trunk svn. >> >> Please check I haven't broken anything :-) >> >> Tim >> >> A.M. Kuchling wrote: >> > On Fri, Apr 20, 2007 at 10:26:42AM +0100, Tim Couper wrote: >> > >> >> I need to know where to put the jython modified version of >> textwrap.py >> >> for code review. Should I submit a patch relative to the py2.5 >> version >> >> of textwrap.py, or it that going to cause confusion? Guidance >> please :-) >> >> >> > >> > Does the 2.5 textwrap.py need a modification to work with Jython? If >> > yes, please submit it as a patch and I'll take a look at committing it >> > to the 2.5-maint and 2.6 trunk in Python's CVS, and to the 2.2-maint >> > branch. >> > >> > --amk >> > >> > >> > >> ------------------------------------------------------------------------- >> >> > This SF.net email is sponsored by DB2 Express >> > Download DB2 Express C - the FREE version of DB2 express and take >> > control of your XML. No limits. Just data. Click to get it now. >> > http://sourceforge.net/powerbar/db2/ >> > _______________________________________________ >> > Jython-dev mailing list >> > Jyt...@li... >> > https://lists.sourceforge.net/lists/listinfo/jython-dev >> > >> > >> > >> >> ------------------------------------------------------------------------- >> >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Jython-dev mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-dev >> > > |