Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 7646] New: strftime on datetime not works on python3.
@ 2014-11-12 12:55 bugzilla at busybox.net
  2014-11-12 13:11 ` [Buildroot] [Bug 7646] " bugzilla at busybox.net
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2014-11-12 12:55 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=7646

           Summary: strftime on datetime not works on python3.
           Product: buildroot
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P5
         Component: Outdated package
        AssignedTo: unassigned at buildroot.uclibc.org
        ReportedBy: beyonlo at gmail.com
                CC: buildroot at uclibc.org
   Estimated Hours: 0.0


I set python3 to compile in buildroot and the strftime not works:


# uname -a
Linux buildroot 3.13.5 #1 Wed Nov 12 09:42:52 BRST 2014 armv5tejl GNU/Linux
# python3
Python 3.4.1 (default, Nov 12 2014, 09:22:50) 
[GCC 4.4.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> datetime.now().strftime("%Y-%m-%d %H:%M:%S")
''
>>> 

As I know, strftime use locale. So I change toolchain to:
"[*] Toolchain has locale support?"

And compile buildroot again. But still not works. The same problem.

However, I tried to do a simple test in C using locale. The strftime works fine
in C.

# uname -a
Linux buildroot 3.13.5 #1 Wed Nov 12 09:42:52 BRST 2014 armv5tejl GNU/Linux
# file test2
test2: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically
linked (uses shared libs), not stripped
# ./test2 
Locale is: (null)
Locale is: (null)
Date is: Fri Sep 12 16:34:33 2014
# 

This is the c example compiled (using arm cross compile) in the host and put in
the embedded buildroot:
$ cat test2.c 
#include <locale.h>
#include <stdio.h>
#include <time.h>

int main ()
{
   time_t currtime;
   struct tm *timer;
   char buffer[80];

   time( &currtime );
   timer = localtime( &currtime );

   printf("Locale is: %s\n", setlocale(LC_ALL, "en_US"));
   printf("Locale is: %s\n", setlocale(LC_CTYPE, "en_US.UTF-8"));
   strftime(buffer,80,"%c", timer );
   printf("Date is: %s\n", buffer);

   return(0);
}

Thank you.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-11-14  8:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 12:55 [Buildroot] [Bug 7646] New: strftime on datetime not works on python3 bugzilla at busybox.net
2014-11-12 13:11 ` [Buildroot] [Bug 7646] " bugzilla at busybox.net
2014-11-12 13:12 ` bugzilla at busybox.net
2014-11-12 13:18 ` bugzilla at busybox.net
2014-11-12 14:33 ` bugzilla at busybox.net
2014-11-12 22:28 ` bugzilla at busybox.net
2014-11-12 22:33 ` bugzilla at busybox.net
2014-11-12 22:45 ` bugzilla at busybox.net
2014-11-13 10:36 ` bugzilla at busybox.net
2014-11-13 10:45 ` bugzilla at busybox.net
2014-11-13 12:18 ` bugzilla at busybox.net
2014-11-13 20:31 ` bugzilla at busybox.net
2014-11-13 22:37 ` bugzilla at busybox.net
2014-11-14  8:28 ` bugzilla at busybox.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox