Bug 838647 - with LANG=zh_CN.utf set, datetime.datetime.strptime('%x', time.strftime('%x')) fails
with LANG=zh_CN.utf set, datetime.datetime.strptime('%x', time.strftime('%x')...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Python Maintainers
BaseOS QE - Apps
Depends On:
  Show dependency treegraph
Reported: 2012-07-09 13:15 EDT by Adrian Likins
Modified: 2017-09-06 09:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-09-06 09:34:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Python 8957 None None None Never

  None (edit)
Description Adrian Likins 2012-07-09 13:15:44 EDT
Description of problem:

if LANG is set to zh_CN.UTF8, the python code like:

import datetime
import time
import os
import locale

os.environ['LANG'] = "zh_CN.utf8"
locale.setlocale(locale.LC_ALL, '')

print datetime.datetime.strptime('%x', time.strftime('%x'))

ie, trying to parse the localized date format with strptime
fails even when using the same format ('%x') 

I suspect this might be related to 
https://bugzilla.redhat.com/show_bug.cgi?id=785984, though trying:
  LANG=zh_CN.utf8 date --date="$(date +'%x' -d '10/11/2011') " "+%x"

Seems to work okay.

[adrian@dhcp231-28 ~]$ rpm -q python glibc-common
Comment 2 RHEL Product and Program Management 2012-12-14 03:38:43 EST
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 3 Bohuslav "Slavek" Kabrda 2014-02-14 06:34:20 EST
I'm linking upstream bug that tries to address this, currently without a viable solution, I think.
Comment 4 Bohuslav "Slavek" Kabrda 2015-01-07 09:06:41 EST
Since upstream still hasn't agreed on solution and this has a potential of behaviour change, I'm moving this bug to 6.8.
Comment 6 Honza Horak 2017-09-06 09:34:36 EDT
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:


Note You need to log in before you can comment on or make changes to this bug.