Terry J. Reedy added the comment:

I verified Marks 3.4.1 result with Idle.

It strikes me as a bug that a function that maps a unicode format string to a 
unicode string with interpolations added should ever encode the format to 
bytes, lets alone using using an encoding that fails or loses information.  It 
is especially weird given that % formatting does not even work (at present) for 
bytes.

It seems to me that strftime should never encode the non-special parts of the 
format text.  Instead, it could split the format (re.split) into a list of 
alternatine '%x' pairs and running text segments, replace the '%x' entries with 
the proper entries, and return the list joined back into a string. Some 
replacements would be locale dependent, other not.

(Just wondering, are the locate names of days and months bytes restricted to 
ascii or unrestricted unicode using native characters?)

----------
nosy: +terry.reedy
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8304>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to