You Are Here:

Community: Developer Discussion Boards

#1 Old time.strptime function missing? - 2008-02-01, 22:40

Join Date: Jul 2007
Posts: 5
florianosc
Offline
Registered User
I tried to use the function strptime from module time with Python for &0 v. 1.4.1 and 1.4.2, but the following error message 2s displayed:

Code:
AttributeError: 'module' object has no attribute 'strptime'
I checked that syntax is correct. Other functions of "time" module work as expected.

Is it a bug or that function is unimplemented? Where can I find a list of implemented/unimplemented functions in S60 for each standard Python module?

Thanks a lot
Reply With Quote

#2 Old Re: time.strptime function missing? - 2008-02-02, 01:16

Join Date: Jan 2004
Posts: 368
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
Two possible reasons

1) Python 2.2 doesn't have function and it was added in the later Python versions

2) PyS60 is missing datetime API parts which were implemented using native C


Mikko Ohtamaa
Twinapex Research
http://www.twinapex.com
Reply With Quote

#3 Old Re: time.strptime function missing? - 2008-02-02, 01:16

Join Date: Jan 2004
Posts: 368
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
Quote:
Originally Posted by florianosc View Post
Where can I find a list of implemented/unimplemented functions in S60 for each standard Python module?
Download the source code


Mikko Ohtamaa
Twinapex Research
http://www.twinapex.com
Reply With Quote

#4 Old Re: time.strptime function missing? - 2008-02-02, 11:13

Join Date: Jul 2007
Posts: 5
florianosc
Offline
Registered User
Thanks for your reply. I checked what you have suggested.

strptime is included in Python 2.2.

In latest PyS60 sources, the function is indeed present in file timemodule.c, but just before it there is this flag:

Code:
#if 0
/* Enable this if it's not declared in <time.h> */
extern char *strptime(const char *, const char *, struct tm *);
#endif
So I suppose the problem is that, when PyS60 was built, time.h did not declare the function and the above flag was disabled, so strptime was not included in time module.

Do you agree with me? Shall I file a new bug on Sourceforge?

Thanks in advance.
Reply With Quote

#5 Old Re: time.strptime function missing? - 2008-02-02, 12:48

Join Date: Jan 2004
Posts: 368
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
Quote:
Originally Posted by florianosc View Post
Code:
#if 0
/* Enable this if it's not declared in <time.h> */
extern char *strptime(const char *, const char *, struct tm *);
#endif
So I suppose the problem is that, when PyS60 was built, time.h did not declare the function and the above flag was disabled, so strptime was not included in time module.

Do you agree with me? Shall I file a new bug on Sourceforge?
time.h might be missing on Symbian. It doesn't really have any of the standard C libraries. Please, file a bug, and others will know how to deal with the problem.

Also there exist a custom datetime port to PyS60.


Mikko Ohtamaa
Twinapex Research
http://www.twinapex.com
Reply With Quote

#6 Old Re: time.strptime function missing? - 2008-02-02, 17:28

Join Date: May 2007
Posts: 10
mad77
Offline
Registered User
Quote:
Originally Posted by florianosc View Post
Is it a bug or that function is unimplemented? Where can I find a list of implemented/unimplemented functions in S60 for each standard Python module?
In Python, strptime depends on the implementation of the underling operating system; looks like Symbian doesn't have it, so it's not in the time module.

Maybe you can get an implementation from a time.c source file, and use it to reimplement it in Python or build a C module.

HTH
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
S60 2nd to 3rd/ PlatformSecurity / Capabilities jarkoos Installation, Certification and Security 4 2007-04-14 15:08
Missing function "rebuild project" in carbide.c++ 1.1 Express KarstenBln Carbide.c++ IDE and plug-ins 0 2007-03-22 16:27
Problem with Cabride.c++ v1.1 markovuksanovic Carbide.c++ IDE and plug-ins 3 2007-01-24 21:05
Cannot compile SDK's examples for 7650 platform... midletsoft Symbian Tools & SDKs 2 2003-08-12 20:11
Problem with Nokia D211 Linux Drivers fiveam Multimodecards 1 1970-01-01 02:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia