Re: issue 2166 - datetime.strptime does not support %f on Jython 2.7
Jeff Allen <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <[email protected]> |
I use Eclipse too, so can help. Those notes are slightly out of date. The Wiki is somewhat unloved. It used to be the case that Eclipse files .classpath, etc. were in the checkout, but recently we decided not to control IDE config. Now you have to work it out from a blank canvas. We dropped them because they added off-topic "noise" to change sets (you don't care that I have added a source attachment to something), and were always out of sync anyway (e.g. Jim, who uses IDEA, updates a JAR version and now my .classpath is wrong). It makes it slightly harder to get started: I can send you my config if you like. I have to confess I have also tweaked the style ever-so-slightly from the one on the Wiki, to master some minor white space issues. Jeff Allen On 12/08/2014 03:01, Anthony Kong wrote: > Hi Jeff, > > No worries. I will try another issue then. > > I have already check out the code base on macbookpro and compiled it. > I am setting up my eclipse for jython by following the instructions > here: https://wiki.python.org/jython/JythonDeveloperGuide/EclipseNotes > > There is another devguide on jython and I am reading through it too. > > Cheers, Tony > > > > On Tue, Aug 12, 2014 at 8:20 AM, Jeff Allen <[email protected] > <mailto:[email protected]>> wrote: > > I don't think #2166 is fixed. However, we are offered this against > it: https://github.com/jythontools/jython/pull/7 as a result of > Indra's antipodean sprint. (See his message 7 August.) It would be > senseless to duplicate. It has some technical problems, but it > seems to be along the lines Tony identified. I've added a note on > the bug-tracker. > > Tony: that was an unlucky choice, given the number of open bugs, > but you're very welcome to contribute. Have you managed to set up > a development environment from which you can work? > > Jeff > > On 11/08/2014 17:05, Santoso Wijaya wrote: >> Time.java has changed since then. I believe this issue was >> addressed, as well, along with issue 2112 >> (http://bugs.jython.org/issue2112#) in the linked change. >> >> ~/santoso >> >> >> On Sun, Aug 10, 2014 at 11:57 PM, Anthony Kong >> <[email protected] <mailto:[email protected]>> wrote: >> >> Hi all, >> >> I would like to make some contribution to the jython project. >> I browsed the bug tracker and randomly picked this issue as a >> starting point: http://bugs.jython.org/issue2166 >> >> I think this is the cause of the bug: >> >> >> In src/org/python/modules/time/Time.java, function 'private >> static PyTuple pystrptime(String data_string, String format)' >> , it calls _strptime._strptime_time to parse the data_string >> according to the format. But this function does not >> understand '%f' flag. >> >> >> >> >>> from _strptime import _strptime_time >> >> >>> _strptime_time('2014-06-16 17:03:58.483000', '%Y-%m-%d >> %H:%M:%S.%f') >> >> time.struct_time(tm_year=2014, tm_mon=6, tm_mday=16, >> tm_hour=17, tm_min=3, tm_sec=58, tm_wday=0, tm_yday=167, >> tm_isdst=-1) >> >> >> If we call _strptime instead, we will get this result instead: >> >> >>> from _strptime import _strptime >> >> >>> _strptime('2014-06-16 17:03:58.483000', '%Y-%m-%d >> %H:%M:%S.%f') >> >> (time.struct_time(tm_year=2014, tm_mon=6, tm_mday=16, >> tm_hour=17, tm_min=3, tm_sec=58, tm_wday=0, tm_yday=167, >> tm_isdst=-1), 483000) >> >> >> I am not sure what is the best way to fix this problem. Does >> it make sense to switch to use _strptime when there is a %f >> flag presence? I would love to hear some suggestions so I can >> learn more the jython codebase, and hopefully, be able to >> patch it and give something back to the community. >> >> >> Thanks, Tony >> >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Jython-dev mailing list > [email protected] > <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/jython-dev > > ------------------------------------------------------------------------------ _______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-dev