All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla at busybox.net <bugzilla@busybox.net>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 7646] New: strftime on datetime not works on python3.
Date: Wed, 12 Nov 2014 12:55:04 +0000 (UTC)	[thread overview]
Message-ID: <bug-7646-163@https.bugs.busybox.net/> (raw)

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.

             reply	other threads:[~2014-11-12 12:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 12:55 bugzilla at busybox.net [this message]
2014-11-12 13:11 ` [Buildroot] [Bug 7646] strftime on datetime not works on python3 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-7646-163@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.