Re: rstrip error python2.4.3 not in 2.5.1?
- From: Philipp Pagel <pDOTpagel@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:41:29 +0000 (UTC)
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 ‘
%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
.
- References:
- rstrip error python2.4.3 not in 2.5.1?
- From: dirkheld
- Re: rstrip error python2.4.3 not in 2.5.1?
- From: Terry Reedy
- Re: rstrip error python2.4.3 not in 2.5.1?
- From: dirkheld
- rstrip error python2.4.3 not in 2.5.1?
- Prev by Date: Re: rstrip error python2.4.3 not in 2.5.1?
- Next by Date: A python STUN client is ready on Google Code.
- Previous by thread: Re: rstrip error python2.4.3 not in 2.5.1?
- Next by thread: Re: rstrip error python2.4.3 not in 2.5.1?
- Index(es):
Relevant Pages
|