Re: rstrip error python2.4.3 not in 2.5.1?



dirkheld <dirkheld@xxxxxxxxx> wrote:

Here it is : I tought that I didn't matter because the deliciousapi
worked fine on my mac.

Traceback (most recent call last):
File "delgraph.py", line 62, in ?
url_metadata = d.get_url(site.rstrip())
File "deliciousapi.py", line 269, in get_url
document.bookmarks =
self._extract_bookmarks_from_url_history(data)
File "deliciousapi.py", line 297, in
_extract_bookmarks_from_url_history
timestamp = datetime.datetime.strptime(month_string, '%b &lsquo;
%y')
AttributeError: type object 'datetime.datetime' has no attribute
'strptime'

The answer is right there: datetime.datetime has method strptime in
python 2.5 but which was not available in 2.4. A quick look into the
library reference confirms this:

----------------------------------------------------------------------
strptime( date_string, format)
Return a datetime corresponding to date_string, parsed according to format.
This is equivalent to datetime(*(time.strptime(date_string, format)[0:6])).
ValueError is raised if the date_string and format can't be parsed by
time.strptime() or if it returns a value which isn't a time tuple.

New in version 2.5.
----------------------------------------------------------------------

cu
Philipp

--
Dr. Philipp Pagel
Lehrstuhl f. Genomorientierte Bioinformatik
Technische Universität München
http://mips.gsf.de/staff/pagel
.



Relevant Pages

  • Re: word 97 compatibility
    ... The Word X file format on the Mac is identical to the Word 97/2000/2002/2003 ... That compression is Stuffit compression. ... extensions for years, ...
    (microsoft.public.mac.office.word)
  • Re: Collapse of a Brief Empire
    ... if you are a company and "ask" you can obviously get a Mac ... Apple will of course ship a company Macs without an OS ... Then format it, done deal, it's exactly the same amount of time to get a ... "install the os" are long gone...... ...
    (comp.sys.mac.advocacy)
  • Re: Word 2008: unable to insert image once document is saved
    ... I haven't found a good workaround yet; and frankly I am a bit amazed that I ... don't see more people in the Mac forum complaining about this MS bug. ... you'd clarify the points about differing file types & saved v. ... format is not recognized by Word. ...
    (microsoft.public.mac.office.word)
  • Re: Follow-up to - Document Format changes in Word 2004
    ... All this aside, referring to the previous Mac PC problem, I'm a little ... > My client has 8 different people who will either create or edit/modify ... > Office 2004 has several options that can be set to maintain format ... > PC computers have been long standing and have been lived with through ...
    (microsoft.public.mac.office.word)
  • Value/modem/PPP/download (was: Lisp/Unix impedance [a programming...])
    ... Better than the 56K modem on my Mac, which is already faster than my ... your claim you cannot download any data is also bogus. ... whereby it expects all files to be in DOS format before download and it ...
    (comp.lang.lisp)